|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Used to authenticate users in a servlet request. Applications will implement the Authenticator interface with a bean for authentication.
In general, applications should extend AbstractAuthenticator instead to protect from API changes in the Authenticator.
Method Summary | |
java.security.Principal |
authenticate(HttpServletRequest request)
Authenticate a user for the current request. |
void |
init(CauchoApplication app,
RegistryNode params)
Initialize the authenticator. |
boolean |
isUserInRole(HttpServletRequest request,
java.security.Principal user,
java.lang.String role)
Returns true if the user plays the named role. |
java.security.Principal |
login(HttpServletRequest request,
HttpServletResponse response,
java.lang.String user,
java.lang.String password,
boolean allowCookie)
Logs a user in with a user name and a password. |
void |
logout(HttpServletRequest request)
Logs the user out from the given request. |
Method Detail |
public void init(CauchoApplication app, RegistryNode params) throws ServletException
app
- the owning servlet context.public java.security.Principal authenticate(HttpServletRequest request) throws ServletException
request
- the request trying to authenticate.public java.security.Principal login(HttpServletRequest request, HttpServletResponse response, java.lang.String user, java.lang.String password, boolean allowCookie) throws ServletException
request
- servlet requestresponse
- servlet response, in case any cookie need sending.user
- the user name.password
- the user's presented password.allowCookie
- true if the user allows cookies for
subsequent requests.public boolean isUserInRole(HttpServletRequest request, java.security.Principal user, java.lang.String role) throws ServletException
request
- the request testing the role.user
- the user's Principal.role
- role name.public void logout(HttpServletRequest request) throws ServletException
Generally only called from user code.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |