com.caucho.server.http
Class JdbcAuthenticator
java.lang.Object
|
+--com.caucho.server.http.AbstractAuthenticator
|
+--com.caucho.server.http.JdbcAuthenticator
- All Implemented Interfaces:
- Authenticator
- public class JdbcAuthenticator
- extends AbstractAuthenticator
Method Summary |
java.security.Principal |
authenticate(java.lang.String username,
java.lang.String password)
Authenticates the user given the request. |
java.security.Principal |
authenticateCookie(java.lang.String cookieValue)
Authenticate based on a cookie. |
void |
init()
Initialize the authenticator. |
boolean |
isUserInRole(java.security.Principal principal,
java.lang.String role)
|
boolean |
updateCookie(java.security.Principal user,
java.lang.String cookieValue)
Associates a user with a persistent cookie. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JdbcAuthenticator
public JdbcAuthenticator()
init
public void init()
throws ServletException
- Initialize the authenticator.
- Overrides:
init
in class AbstractAuthenticator
authenticateCookie
public java.security.Principal authenticateCookie(java.lang.String cookieValue)
- Authenticate based on a cookie.
- Overrides:
authenticateCookie
in class AbstractAuthenticator
- Parameters:
cookieValue
- the value of the resin-auth cookie- Returns:
- the user for the cookie.
updateCookie
public boolean updateCookie(java.security.Principal user,
java.lang.String cookieValue)
- Associates a user with a persistent cookie.
- Overrides:
updateCookie
in class AbstractAuthenticator
- Parameters:
user
- the user for the cookiecookieValue
- the value of the resin-auth cookie- Returns:
- true if the cookie value is valid, i.e. it's unique
authenticate
public java.security.Principal authenticate(java.lang.String username,
java.lang.String password)
- Authenticates the user given the request.
- Overrides:
authenticate
in class AbstractAuthenticator
- Parameters:
username
- the user name for the loginpassword
- the password for the login- Returns:
- the authenticated user or null for a failure
isUserInRole
public boolean isUserInRole(java.security.Principal principal,
java.lang.String role)
- Overrides:
isUserInRole
in class AbstractAuthenticator