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 org.alfresco.service.cmr.repository.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(HttpSession session,
String userName)
Callback to create the User environment as appropriate for a filter impl
|
protected SessionUser |
createUserEnvironment(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(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(ServletContext servletContext,
HttpServletRequest httpServletRequest,
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(HttpServletRequest req,
HttpServletResponse res)
Handles the login form directly, allowing management of the session user.
|
protected void |
invalidateSession(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(org.alfresco.service.cmr.repository.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 org.alfresco.service.cmr.repository.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(org.alfresco.service.cmr.repository.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)
authenticationListener
- AuthenticationListenerpublic void setRemoteUserMapper(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(ServletContext servletContext, HttpServletRequest httpServletRequest, 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(HttpServletRequest req)
req
- HttpServletRequestprotected <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(HttpSession session, String userName, String ticket, boolean externalAuth) throws IOException, ServletException
session
- HttpSessionuserName
- Stringticket
- the ticketexternalAuth
- has the user been authenticated by SSO?IOException
- Signals that an I/O exception has occurred.ServletException
- the servlet exceptionprotected SessionUser createUserEnvironment(HttpSession session, String userName) throws IOException, ServletException
session
- HttpSessionuserName
- StringIOException
ServletException
protected abstract org.apache.commons.logging.Log getLogger()
protected boolean handleLoginForm(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException
req
- the requestres
- the responseIOException
- Signals that an I/O exception has occurred.ServletException
- on errorCopyright © 2005–2017 Alfresco Software. All rights reserved.