@Singleton public class LoginList extends java.lang.Object implements Login
LOGIN_PASSWORD, LOGIN_USER, LOGIN_USER_NAME
Constructor and Description |
---|
LoginList() |
Modifier and Type | Method and Description |
---|---|
void |
add(Login login)
Adds the next login in the list.
|
Authenticator |
getAuthenticator()
Returns the configured authenticator
|
java.lang.String |
getAuthType()
Returns the authentication type.
|
java.util.ArrayList<Login> |
getLoginList()
Returns the login list.
|
java.security.Principal |
getUserPrincipal(HttpServletRequest request)
Returns the Principal associated with the current request.
|
boolean |
isLoginUsedForRequest(HttpServletRequest request)
Returns true if the login is used for this request
|
boolean |
isPasswordBased()
Returns true if username and password based authentication is supported.
|
boolean |
isUserInRole(java.security.Principal user,
java.lang.String role)
Returns true if the current user plays the named role.
|
java.security.Principal |
login(HttpServletRequest request,
HttpServletResponse response,
boolean isFail)
Logs a user in.
|
void |
logout(java.security.Principal user,
HttpServletRequest request,
HttpServletResponse response)
Logs the user out from the given request.
|
void |
sessionInvalidate(HttpSession session,
boolean isTimeout)
Called when the session invalidates.
|
java.lang.String |
toString() |
public void add(Login login)
public java.util.ArrayList<Login> getLoginList()
public java.lang.String getAuthType()
getAuthType
is called
by HttpServletRequest.getAuthType
.getAuthType
in interface Login
public Authenticator getAuthenticator()
getAuthenticator
in interface Login
public boolean isLoginUsedForRequest(HttpServletRequest request)
isLoginUsedForRequest
in interface Login
public java.security.Principal getUserPrincipal(HttpServletRequest request)
getUserPrincipal
in interface Login
request
- servlet requestpublic java.security.Principal login(HttpServletRequest request, HttpServletResponse response, boolean isFail)
authenticate
sets the reponse error page and returns null.public boolean isPasswordBased()
isPasswordBased
in interface Login
BasicLogin
public boolean isUserInRole(java.security.Principal user, java.lang.String role)
isUserInRole
is called in response to the
HttpServletRequest.isUserInRole
call.isUserInRole
in interface Login
user
- the logged in userrole
- the role to checkpublic void logout(java.security.Principal user, HttpServletRequest request, HttpServletResponse response)
Since there is no servlet API for logout, this must be called directly from user code. Resin stores the web-app's login object in the ServletContext attribute "caucho.login".
public void sessionInvalidate(HttpSession session, boolean isTimeout)
sessionInvalidate
in interface Login
public java.lang.String toString()
toString
in class java.lang.Object