public abstract class BaseAuthenticationFilter extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static String |
ARG_TICKET
The name of the ticket argument.
|
static String |
AUTHENTICATION_USER
The default session attribute used to cache the user.
|
protected AuthenticationComponent |
authenticationComponent
The authentication component.
|
protected AuthenticationListener |
authenticationListener
The authentication listener.
|
protected AuthenticationService |
authenticationService
The authentication service.
|
protected static String |
NO_AUTH_REQUIRED
Indication by an up-stream filter that no authentication checks are required.
|
protected NodeService |
nodeService
The node service.
|
protected PersonService |
personService
The person service.
|
protected RemoteUserMapper |
remoteUserMapper
The remote user mapper.
|
protected TransactionService |
transactionService
The transaction service.
|
| Constructor and Description |
|---|
BaseAuthenticationFilter() |
| Modifier and Type | Method and Description |
|---|---|
protected SessionUser |
createUserEnvironment(javax.servlet.http.HttpSession session,
String userName)
Callback to create the User environment as appropriate for a filter impl
|
protected SessionUser |
createUserEnvironment(javax.servlet.http.HttpSession session,
String userName,
String ticket,
boolean externalAuth)
Callback to create the User environment as appropriate for a filter impl.
|
protected SessionUser |
createUserObject(String userName,
String ticket,
NodeRef personNode,
NodeRef homeSpaceRef)
Create the user object that will be stored in the session.
|
protected <T> T |
doInSystemTransaction(RetryingTransactionHelper.RetryingTransactionCallback<T> callback)
Executes a callback in a transaction as the system user
|
protected abstract org.apache.commons.logging.Log |
getLogger()
Return the logger.
|
protected SessionUser |
getSessionUser(javax.servlet.ServletContext servletContext,
javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse,
boolean externalAuth)
Callback to get the specific impl of the Session User for a filter.
|
protected String |
getUserAttributeName()
Return the user object session attribute name.
|
protected boolean |
handleLoginForm(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Handles the login form directly, allowing management of the session user.
|
protected void |
invalidateSession(javax.servlet.http.HttpServletRequest req)
Remove the user from the session and expire the session - after failed ticket auth.
|
void |
setAuthenticationComponent(AuthenticationComponent authenticationComponent)
Sets the authentication component.
|
void |
setAuthenticationListener(AuthenticationListener authenticationListener)
Sets the authentication listener.
|
void |
setAuthenticationService(AuthenticationService authenticationService)
Sets the authentication service.
|
void |
setNodeService(NodeService nodeService)
Sets the node service.
|
void |
setPersonService(PersonService personService)
Sets the person service.
|
void |
setRemoteUserMapper(RemoteUserMapper remoteUserMapper)
Sets the remote user mapper.
|
void |
setTransactionService(TransactionService transactionService)
Sets the transaction service.
|
protected void |
setUserAttributeName(String userAttr)
Set the user object attribute name.
|
protected static final String NO_AUTH_REQUIRED
public static final String AUTHENTICATION_USER
setUserAttributeName(String).protected static final String ARG_TICKET
protected AuthenticationService authenticationService
protected PersonService personService
protected NodeService nodeService
protected TransactionService transactionService
protected AuthenticationComponent authenticationComponent
protected RemoteUserMapper remoteUserMapper
protected AuthenticationListener authenticationListener
public void setAuthenticationService(AuthenticationService authenticationService)
authenticationService - the authService to setpublic void setPersonService(PersonService personService)
personService - the personService to setpublic void setNodeService(NodeService nodeService)
nodeService - the nodeService to setpublic void setTransactionService(TransactionService transactionService)
transactionService - the transactionService to setpublic void setAuthenticationComponent(AuthenticationComponent authenticationComponent)
authenticationComponent - the authentication componentpublic void setAuthenticationListener(AuthenticationListener authenticationListener)
- public void setRemoteUserMapper(RemoteUserMapper remoteUserMapper)
remoteUserMapper - the remote user mapperprotected SessionUser createUserObject(String userName, String ticket, NodeRef personNode, NodeRef homeSpaceRef)
userName - Stringticket - StringpersonNode - NodeRefhomeSpaceRef - NodeRefprotected SessionUser getSessionUser(javax.servlet.ServletContext servletContext, javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, boolean externalAuth)
servletContext - the servlet contexthttpServletRequest - the http servlet requesthttpServletResponse - the http servlet responseexternalAuth - has the user been authenticated by SSO?protected void invalidateSession(javax.servlet.http.HttpServletRequest req)
session - the sessionprotected <T> T doInSystemTransaction(RetryingTransactionHelper.RetryingTransactionCallback<T> callback)
callback - the callbackprotected final String getUserAttributeName()
protected final void setUserAttributeName(String userAttr)
userAttr - the user object session attribute nameprotected SessionUser createUserEnvironment(javax.servlet.http.HttpSession session, String userName, String ticket, boolean externalAuth) throws IOException, javax.servlet.ServletException
session - HttpSessionuserName - Stringticket - the ticketexternalAuth - has the user been authenticated by SSO?IOException - Signals that an I/O exception has occurred.javax.servlet.ServletException - the servlet exceptionprotected SessionUser createUserEnvironment(javax.servlet.http.HttpSession session, String userName) throws IOException, javax.servlet.ServletException
session - HttpSessionuserName - StringIOExceptionjavax.servlet.ServletExceptionprotected abstract org.apache.commons.logging.Log getLogger()
protected boolean handleLoginForm(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws IOException,
javax.servlet.ServletException
req - the requestres - the responseIOException - Signals that an I/O exception has occurred.javax.servlet.ServletException - on errorCopyright © 2005–2014 Alfresco Software. All rights reserved.