|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.seraph.auth.AbstractAuthenticator
public abstract class AbstractAuthenticator
An abstract implementation of Authenticator that implements a lot of base methods
Field Summary |
---|
Fields inherited from interface com.atlassian.seraph.auth.Authenticator |
---|
DEFAULT_AUTHENTICATOR |
Constructor Summary | |
---|---|
AbstractAuthenticator()
|
Method Summary | |
---|---|
void |
destroy()
|
protected SecurityConfig |
getConfig()
|
String |
getRemoteUser(javax.servlet.http.HttpServletRequest request)
Gets the username of the Principal authenticated for the given HttpServletRequest . |
Principal |
getUser(javax.servlet.http.HttpServletRequest request)
Gets the Principal authenticated for the given HttpServletRequest . |
abstract Principal |
getUser(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Gets the Principal for the HttpServletRequest . |
void |
init(Map<String,String> params,
SecurityConfig config)
Initialise the configuration object with the given "init-params". |
abstract boolean |
isUserInRole(javax.servlet.http.HttpServletRequest request,
String role)
Deprecated. Use RoleMapper directly |
boolean |
login(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String username,
String password)
Tries to authenticate a user. |
abstract boolean |
login(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
String username,
String password,
boolean cookie)
Tries to authenticate a user. |
abstract boolean |
logout(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractAuthenticator()
Method Detail |
---|
public void init(Map<String,String> params, SecurityConfig config)
Initable
init
in interface Initable
params
- The map of "init-params" extracted from the Seraph config file. This is guaranteed not null.config
- The Seraph SecurityConfig class that is initialising the config objects. This object will only be partially initialised at this time.public void destroy()
destroy
in interface Authenticator
@Deprecated public abstract boolean isUserInRole(javax.servlet.http.HttpServletRequest request, String role)
RoleMapper
directly
isUserInRole
in interface Authenticator
public String getRemoteUser(javax.servlet.http.HttpServletRequest request)
Authenticator
Principal
authenticated for the given HttpServletRequest
.
getRemoteUser
in interface Authenticator
public Principal getUser(javax.servlet.http.HttpServletRequest request)
Authenticator
Principal
authenticated for the given HttpServletRequest
.
getUser
in interface Authenticator
public abstract Principal getUser(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Authenticator
Principal
for the HttpServletRequest
. The RememberMeToken
will be regenerated for the HttpServletResponse
if the token is invalid.
getUser
in interface Authenticator
public boolean login(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String username, String password) throws AuthenticatorException
Authenticator
login
in interface Authenticator
request
- the HttpServletRequestresponse
- the HttpServletResponseusername
- the user name to check against the passwordpassword
- the password to authenticate the user with
AuthenticatorException
- if an error occurs that stops the user from being authenticated (eg remote communication failure).public abstract boolean login(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, String username, String password, boolean cookie) throws AuthenticatorException
Authenticator
login
in interface Authenticator
request
- the HttpServletRequestresponse
- the HttpServletResponseusername
- the user name to check against the passwordpassword
- the password to authenticate the user withcookie
- whether to set a remember me cookie on successful login
AuthenticatorException
- if an error occurs that stops the user from being authenticated (eg remote communication failure).public abstract boolean logout(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws AuthenticatorException
logout
in interface Authenticator
AuthenticatorException
protected SecurityConfig getConfig()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |