Class AbstractChainingAuthenticationComponent
java.lang.Object
org.alfresco.repo.security.authentication.AbstractAuthenticationComponent
org.alfresco.repo.security.authentication.AbstractChainingAuthenticationComponent
- All Implemented Interfaces:
AuthenticationComponent,AuthenticationContext
- Direct Known Subclasses:
SubsystemChainingAuthenticationComponent
public abstract class AbstractChainingAuthenticationComponent
extends AbstractAuthenticationComponent
A base class for chaining authentication components. Where appropriate, methods will 'chain' across multiple
AuthenticationComponent instances, as returned by getUsableAuthenticationComponents().- Author:
- dward
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.alfresco.repo.security.authentication.AuthenticationComponent
AuthenticationComponent.UserNameValidationMode -
Field Summary
Fields inherited from class org.alfresco.repo.security.authentication.AbstractAuthenticationComponent
logger -
Constructor Summary
ConstructorsConstructorDescriptionInstantiates a new abstract chaining authentication component. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidauthenticateImpl(String userName, char[] password) Chain authentication with user name and password - tries all in order until one works, or fails.protected abstract AuthenticationComponentGet the authentication component with the specified nameGets a set of user names who for this particular authentication system should be considered administrators by default.Gets a set of user names who for this particular authentication system should be considered guests by default.protected abstract Collection<AuthenticationComponent>Gets the authentication components across which methods will chain.protected booleanIf any implementation supports guest then guest is allowed.net.sf.acegisecurity.AuthenticationsetCurrentUser(String userName) Set the current user - try all implementations - as some may check the user exists.net.sf.acegisecurity.AuthenticationsetCurrentUser(String userName, AuthenticationComponent.UserNameValidationMode validationMode) Explicitly set the current user to be authenticated.voidtestAuthenticate(String authenticatorName, String userName, char[] password) Test authenticate with a specific authenticator and user name and password.Methods inherited from class org.alfresco.repo.security.authentication.AbstractAuthenticationComponent
authenticate, clearCurrentSecurityContext, getAllowGuestLogin, getCurrentAuthentication, getCurrentUserName, getGuestUserName, getGuestUserName, getNodeService, getNumberFailedAuthentications, getNumberSuccessfulAuthentications, getPersonService, getSystemUserName, getSystemUserName, getTransactionService, getUserDetails, getUserDomain, guestUserAuthenticationAllowed, isCurrentUserTheSystemUser, isGuestUserName, isSystemUserName, onAuthenticate, onFail, setAllowGuestLogin, setAuthenticationContext, setCurrentAuthentication, setDefaultAdministratorUserNameList, setDefaultAdministratorUserNames, setDefaultGuestUserNameList, setDefaultGuestUserNames, setGuestUserAsCurrentUser, setNodeService, setPersonService, setSystemUserAsCurrentUser, setSystemUserAsCurrentUser, setTransactionService, setUserDetails, setUserRegistrySynchronizer
-
Constructor Details
-
AbstractChainingAuthenticationComponent
public AbstractChainingAuthenticationComponent()Instantiates a new abstract chaining authentication component.
-
-
Method Details
-
getAuthenticationComponent
Get the authentication component with the specified name- Parameters:
name- String- Returns:
- the authentication component or null if it does not exist
-
getUsableAuthenticationComponents
Gets the authentication components across which methods will chain.- Returns:
- the usable authentication components
-
authenticateImpl
Chain authentication with user name and password - tries all in order until one works, or fails.- Overrides:
authenticateImplin classAbstractAuthenticationComponent- Parameters:
userName- the user namepassword- the password- Throws:
AuthenticationException
-
testAuthenticate
Test authenticate with a specific authenticator and user name and password.- Parameters:
authenticatorName- the name of the authenticator to useuserName- the user namepassword- the password- Throws:
AuthenticationException- including diagnostic information about the failure
-
implementationAllowsGuestLogin
protected boolean implementationAllowsGuestLogin()If any implementation supports guest then guest is allowed.- Specified by:
implementationAllowsGuestLoginin classAbstractAuthenticationComponent- Returns:
- true, if implementation allows guest login
-
setCurrentUser
public net.sf.acegisecurity.Authentication setCurrentUser(String userName, AuthenticationComponent.UserNameValidationMode validationMode) Description copied from interface:AuthenticationComponentExplicitly set the current user to be authenticated. Specify if the userName is to be checked and fixed- Specified by:
setCurrentUserin interfaceAuthenticationComponent- Overrides:
setCurrentUserin classAbstractAuthenticationComponent
-
setCurrentUser
Set the current user - try all implementations - as some may check the user exists.- Specified by:
setCurrentUserin interfaceAuthenticationComponent- Overrides:
setCurrentUserin classAbstractAuthenticationComponent- Parameters:
userName- the user name- Returns:
- the authentication
-
getDefaultAdministratorUserNames
Gets a set of user names who for this particular authentication system should be considered administrators by default. If the security framework is case sensitive these values should be case sensitive user names. If the security framework is not case sensitive these values should be the lower-case user names.- Specified by:
getDefaultAdministratorUserNamesin interfaceAuthenticationComponent- Overrides:
getDefaultAdministratorUserNamesin classAbstractAuthenticationComponent- Returns:
- a set of user names
-
getDefaultGuestUserNames
Gets a set of user names who for this particular authentication system should be considered guests by default. If the security framework is case sensitive these values should be case sensitive user names. If the security framework is not case sensitive these values should be the lower-case user names.- Specified by:
getDefaultGuestUserNamesin interfaceAuthenticationComponent- Overrides:
getDefaultGuestUserNamesin classAbstractAuthenticationComponent- Returns:
- a set of user names
-