net.spy.jwebkit.auth
Class PropPasswdAuthAdaptor

java.lang.Object
  extended by net.spy.SpyObject
      extended by net.spy.jwebkit.auth.PropPasswdAuthAdaptor
All Implemented Interfaces:
AuthAdaptor, DigestSupportAuthAdaptor, PasswordCheckingAuthAdaptor

public class PropPasswdAuthAdaptor
extends net.spy.SpyObject
implements PasswordCheckingAuthAdaptor, DigestSupportAuthAdaptor


Field Summary
static java.lang.String VALID_ROLE
           
 
Constructor Summary
PropPasswdAuthAdaptor()
           
 
Method Summary
 java.security.Principal checkPassword(java.lang.String user, java.lang.String pass)
          Return a Principal representing the given username if the given password is considered valid for the given user.
 void didAuthenticate(java.security.Principal p, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Invoked after a user-agent has successfully authenticated.
 java.lang.String getHA1(java.lang.String username, java.lang.String realm)
          Get the HA1 string for authentication.
 void init(javax.servlet.FilterConfig c)
          Initialize this AuthAdaptor with the given filter config.
 boolean isPrincipalInRole(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, javax.servlet.ServletContext context, java.security.Principal user, java.lang.String role)
          Determine whether the given Principal is in the given role.
 
Methods inherited from class net.spy.SpyObject
getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALID_ROLE

public static final java.lang.String VALID_ROLE
See Also:
Constant Field Values
Constructor Detail

PropPasswdAuthAdaptor

public PropPasswdAuthAdaptor()
Method Detail

init

public void init(javax.servlet.FilterConfig c)
          throws javax.servlet.ServletException
Description copied from interface: AuthAdaptor
Initialize this AuthAdaptor with the given filter config.

Specified by:
init in interface AuthAdaptor
Parameters:
c - the filter config
Throws:
javax.servlet.ServletException - if initialization fails

checkPassword

public java.security.Principal checkPassword(java.lang.String user,
                                             java.lang.String pass)
                                      throws javax.servlet.ServletException
Description copied from interface: PasswordCheckingAuthAdaptor
Return a Principal representing the given username if the given password is considered valid for the given user.

Specified by:
checkPassword in interface PasswordCheckingAuthAdaptor
Parameters:
user - the username
pass - the password
Returns:
the Principal representing the user, or null if the credentials are invalid
Throws:
javax.servlet.ServletException - if something goes wrong

isPrincipalInRole

public boolean isPrincipalInRole(javax.servlet.http.HttpServletRequest req,
                                 javax.servlet.http.HttpServletResponse res,
                                 javax.servlet.ServletContext context,
                                 java.security.Principal user,
                                 java.lang.String role)
Description copied from interface: AuthAdaptor
Determine whether the given Principal is in the given role.

Specified by:
isPrincipalInRole in interface AuthAdaptor
Parameters:
req - servlet request
res - servlet response
context - the servlet context
user - the Principa
role - the role we need
Returns:
true if the user is in the given role

getHA1

public java.lang.String getHA1(java.lang.String username,
                               java.lang.String realm)
Description copied from interface: DigestSupportAuthAdaptor
Get the HA1 string for authentication. This string is computed by concatenating the username, the realm, and the password with colons, and then returning the hex encoded digest of this value.

Specified by:
getHA1 in interface DigestSupportAuthAdaptor
Returns:
the HA1 value

didAuthenticate

public void didAuthenticate(java.security.Principal p,
                            javax.servlet.http.HttpServletRequest req,
                            javax.servlet.http.HttpServletResponse res)
Description copied from interface: AuthAdaptor
Invoked after a user-agent has successfully authenticated. Note that this will most likely be called many times since each request will be authenticated individually.

Specified by:
didAuthenticate in interface AuthAdaptor
Parameters:
p - the principal
req - the request
res - the response


Copyright © 1995-2007 SPY Internetworking. All Rights Reserved.