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 multipleAuthenticationComponentinstances, as returned bygetUsableAuthenticationComponents().- 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
Constructors Constructor Description AbstractChainingAuthenticationComponent()Instantiates a new abstract chaining authentication component.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidauthenticateImpl(java.lang.String userName, char[] password)Chain authentication with user name and password - tries all in order until one works, or fails.protected abstract AuthenticationComponentgetAuthenticationComponent(java.lang.String name)Get the authentication component with the specified namejava.util.Set<java.lang.String>getDefaultAdministratorUserNames()Gets a set of user names who for this particular authentication system should be considered administrators by default.java.util.Set<java.lang.String>getDefaultGuestUserNames()Gets a set of user names who for this particular authentication system should be considered guests by default.protected abstract java.util.Collection<AuthenticationComponent>getUsableAuthenticationComponents()Gets the authentication components across which methods will chain.protected booleanimplementationAllowsGuestLogin()If any implementation supports guest then guest is allowed.net.sf.acegisecurity.AuthenticationsetCurrentUser(java.lang.String userName)Set the current user - try all implementations - as some may check the user exists.net.sf.acegisecurity.AuthenticationsetCurrentUser(java.lang.String userName, AuthenticationComponent.UserNameValidationMode validationMode)Explicitly set the current user to be authenticated.voidtestAuthenticate(java.lang.String authenticatorName, java.lang.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
-
-
-
-
Method Detail
-
getAuthenticationComponent
protected abstract AuthenticationComponent getAuthenticationComponent(java.lang.String name)
Get the authentication component with the specified name- Parameters:
name- String- Returns:
- the authentication component or null if it does not exist
-
getUsableAuthenticationComponents
protected abstract java.util.Collection<AuthenticationComponent> getUsableAuthenticationComponents()
Gets the authentication components across which methods will chain.- Returns:
- the usable authentication components
-
authenticateImpl
protected void authenticateImpl(java.lang.String userName, char[] password)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:
org.alfresco.repo.security.authentication.AuthenticationException
-
testAuthenticate
public void testAuthenticate(java.lang.String authenticatorName, java.lang.String userName, char[] password)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:
org.alfresco.repo.security.authentication.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(java.lang.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
public net.sf.acegisecurity.Authentication setCurrentUser(java.lang.String userName)
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
public java.util.Set<java.lang.String> 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
public java.util.Set<java.lang.String> 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
-
-