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 org.alfresco.repo.security.authentication.AuthenticationComponent |
authenticationComponent
The authentication component.
|
protected AuthenticationListener |
authenticationListener
The authentication listener.
|
protected org.alfresco.service.cmr.security.AuthenticationService |
authenticationService
The authentication service.
|
protected static String |
NO_AUTH_REQUIRED
Indication by an up-stream filter that no authentication checks are required.
|
protected org.alfresco.service.cmr.repository.NodeService |
nodeService
The node service.
|
protected org.alfresco.service.cmr.security.PersonService |
personService
The person service.
|
protected org.alfresco.repo.security.authentication.external.RemoteUserMapper |
remoteUserMapper
The remote user mapper.
|
protected org.alfresco.service.transaction.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,
org.alfresco.service.cmr.repository.NodeRef personNode,
org.alfresco.service.cmr.repository.NodeRef homeSpaceRef)
Create the user object that will be stored in the session.
|
protected <T> T |
doInSystemTransaction(org.alfresco.repo.transaction.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(org.alfresco.repo.security.authentication.AuthenticationComponent authenticationComponent)
Sets the authentication component.
|
void |
setAuthenticationListener(AuthenticationListener authenticationListener)
Sets the authentication listener.
|
void |
setAuthenticationService(org.alfresco.service.cmr.security.AuthenticationService authenticationService)
Sets the authentication service.
|
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Sets the node service.
|
void |
setPersonService(org.alfresco.service.cmr.security.PersonService personService)
Sets the person service.
|
void |
setRemoteUserMapper(org.alfresco.repo.security.authentication.external.RemoteUserMapper remoteUserMapper)
Sets the remote user mapper.
|
void |
setTransactionService(org.alfresco.service.transaction.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 org.alfresco.service.cmr.security.AuthenticationService authenticationService
protected org.alfresco.service.cmr.security.PersonService personService
protected org.alfresco.service.cmr.repository.NodeService nodeService
protected org.alfresco.service.transaction.TransactionService transactionService
protected org.alfresco.repo.security.authentication.AuthenticationComponent authenticationComponent
protected org.alfresco.repo.security.authentication.external.RemoteUserMapper remoteUserMapper
protected AuthenticationListener authenticationListener
public void setAuthenticationService(org.alfresco.service.cmr.security.AuthenticationService authenticationService)
authenticationService
- the authService to setpublic void setPersonService(org.alfresco.service.cmr.security.PersonService personService)
personService
- the personService to setpublic void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
nodeService
- the nodeService to setpublic void setTransactionService(org.alfresco.service.transaction.TransactionService transactionService)
transactionService
- the transactionService to setpublic void setAuthenticationComponent(org.alfresco.repo.security.authentication.AuthenticationComponent authenticationComponent)
authenticationComponent
- the authentication componentpublic void setAuthenticationListener(AuthenticationListener authenticationListener)
authenticationListener
- AuthenticationListenerpublic void setRemoteUserMapper(org.alfresco.repo.security.authentication.external.RemoteUserMapper remoteUserMapper)
remoteUserMapper
- the remote user mapperprotected SessionUser createUserObject(String userName, String ticket, org.alfresco.service.cmr.repository.NodeRef personNode, org.alfresco.service.cmr.repository.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)
req
- HttpServletRequestprotected <T> T doInSystemTransaction(org.alfresco.repo.transaction.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
- StringIOException
javax.servlet.ServletException
protected 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–2018 Alfresco Software. All rights reserved.