org.alfresco.repo.security.authentication
Class AbstractChainingAuthenticationComponent

java.lang.Object
  extended by org.alfresco.repo.security.authentication.AbstractAuthenticationComponent
      extended by org.alfresco.repo.security.authentication.AbstractChainingAuthenticationComponent
All Implemented Interfaces:
AuthenticationComponent, AuthenticationContext
Direct Known Subclasses:
ChainingAuthenticationComponentImpl, 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 AbstractChainingAuthenticationComponent.getUsableAuthenticationComponents().


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.alfresco.repo.security.authentication.AuthenticationComponent
AuthenticationComponent.UserNameValidationMode
 
Constructor Summary
AbstractChainingAuthenticationComponent()
          Instantiates a new abstract chaining authentication component.
 
Method Summary
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.
 java.util.Set getDefaultAdministratorUserNames()
          Gets a set of user names who for this particular authentication system should be considered administrators by default.
 java.util.Set getDefaultGuestUserNames()
          Gets a set of user names who for this particular authentication system should be considered guests by default.
protected abstract  java.util.Collection getUsableAuthenticationComponents()
          Gets the authentication components across which methods will chain.
protected  boolean implementationAllowsGuestLogin()
          If any implementation supports guest then guest is allowed.
 net.sf.acegisecurity.Authentication setCurrentUser(java.lang.String userName)
          Set the current user - try all implementations - as some may check the user exists.
 net.sf.acegisecurity.Authentication setCurrentUser(java.lang.String userName, AuthenticationComponent.UserNameValidationMode validationMode)
          Explicitly set the current user to be authenticated.
 
Methods inherited from class org.alfresco.repo.security.authentication.AbstractAuthenticationComponent
authenticate, clearCurrentSecurityContext, getAllowGuestLogin, getCurrentAuthentication, getCurrentUserName, getGuestUserName, getGuestUserName, getNodeService, getPersonService, getSystemUserName, getSystemUserName, getTransactionService, getUserDetails, getUserDomain, guestUserAuthenticationAllowed, isCurrentUserTheSystemUser, isGuestUserName, isSystemUserName, setAllowGuestLogin, setAuthenticationContext, setCurrentAuthentication, setDefaultAdministratorUserNameList, setDefaultAdministratorUserNames, setDefaultGuestUserNameList, setDefaultGuestUserNames, setGuestUserAsCurrentUser, setNodeService, setPersonService, setSystemUserAsCurrentUser, setSystemUserAsCurrentUser, setTransactionService, setUserDetails, setUserRegistrySynchronizer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractChainingAuthenticationComponent

public AbstractChainingAuthenticationComponent()
Instantiates a new abstract chaining authentication component.

Method Detail

getUsableAuthenticationComponents

protected abstract java.util.Collection 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:
authenticateImpl in class AbstractAuthenticationComponent
Parameters:
userName - the user name
password - the password

implementationAllowsGuestLogin

protected boolean implementationAllowsGuestLogin()
If any implementation supports guest then guest is allowed.

Specified by:
implementationAllowsGuestLogin in class AbstractAuthenticationComponent
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: AuthenticationComponent
Explicitly set the current user to be authenticated. Specify if the userName is to be checked and fixed

Specified by:
setCurrentUser in interface AuthenticationComponent
Overrides:
setCurrentUser in class AbstractAuthenticationComponent

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:
setCurrentUser in interface AuthenticationComponent
Overrides:
setCurrentUser in class AbstractAuthenticationComponent
Parameters:
userName - the user name
Returns:
the authentication

getDefaultAdministratorUserNames

public java.util.Set 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:
getDefaultAdministratorUserNames in interface AuthenticationComponent
Overrides:
getDefaultAdministratorUserNames in class AbstractAuthenticationComponent
Returns:
a set of user names

getDefaultGuestUserNames

public java.util.Set 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:
getDefaultGuestUserNames in interface AuthenticationComponent
Overrides:
getDefaultGuestUserNames in class AbstractAuthenticationComponent
Returns:
a set of user names


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.