|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.security.authentication.AbstractAuthenticationComponent
public abstract class AbstractAuthenticationComponent
This class abstract the support required to set up and query the Acegi context for security enforcement. There are some simple default method implementations to support simple authentication.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.alfresco.repo.security.authentication.AuthenticationComponent |
---|
AuthenticationComponent.UserNameValidationMode |
Constructor Summary | |
---|---|
AbstractAuthenticationComponent()
|
Method Summary | |
---|---|
void |
authenticate(java.lang.String userName,
char[] password)
Authenticate |
protected void |
authenticateImpl(java.lang.String userName,
char[] password)
Default unsupported authentication implementation - as of 2.1 this is the best way to implement your own authentication component as it will support guest login - prior to this direct over ride for authenticate(String , char[]) was used. |
void |
clearCurrentSecurityContext()
Remove the current security information |
java.lang.Boolean |
getAllowGuestLogin()
|
net.sf.acegisecurity.Authentication |
getCurrentAuthentication()
Get the current authentication context |
java.lang.String |
getCurrentUserName()
Get the current user name. |
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. |
java.lang.String |
getGuestUserName()
Get the name of the Guest User note: for MT, will get guest for default domain only |
java.lang.String |
getGuestUserName(java.lang.String tenantDomain)
Get the name of the guest user |
org.alfresco.service.cmr.repository.NodeService |
getNodeService()
|
PersonService |
getPersonService()
|
java.lang.String |
getSystemUserName()
Get the name of the system user note: for MT, will get system for default domain only |
java.lang.String |
getSystemUserName(java.lang.String tenantDomain)
Get the name of the system user |
TransactionService |
getTransactionService()
|
protected net.sf.acegisecurity.UserDetails |
getUserDetails(java.lang.String userName)
Default implementation that makes an ACEGI object on the fly |
java.lang.String |
getUserDomain(java.lang.String userName)
Extracts the tenant domain name from a user name |
boolean |
guestUserAuthenticationAllowed()
True if Guest user authentication is allowed, false otherwise |
protected abstract boolean |
implementationAllowsGuestLogin()
|
boolean |
isCurrentUserTheSystemUser()
Is the current user the system user? |
boolean |
isGuestUserName(java.lang.String userName)
True if this is a guest user ? |
boolean |
isSystemUserName(java.lang.String userName)
Is this the system user ? |
void |
setAllowGuestLogin(java.lang.Boolean allowGuestLogin)
Set if guest login is supported. |
void |
setAuthenticationContext(AuthenticationContext authenticationContext)
|
net.sf.acegisecurity.Authentication |
setCurrentAuthentication(net.sf.acegisecurity.Authentication authentication)
Explicitly set the current suthentication. |
net.sf.acegisecurity.Authentication |
setCurrentUser(java.lang.String userName)
Explicitly set the current user to be authenticated. |
net.sf.acegisecurity.Authentication |
setCurrentUser(java.lang.String userName,
AuthenticationComponent.UserNameValidationMode validationMode)
Explicitly set the current user to be authenticated. |
void |
setDefaultAdministratorUserNameList(java.lang.String defaultAdministratorUserNames)
Convenience method to allow the administrator user names to be specified as a comma separated list |
void |
setDefaultAdministratorUserNames(java.util.Set defaultAdministratorUserNames)
Sets the user names who for this particular authentication system should be considered administrators by default. |
void |
setDefaultGuestUserNameList(java.lang.String defaultGuestUserNames)
Convenience method to allow the administrator user names to be specified as a comma separated list |
void |
setDefaultGuestUserNames(java.util.Set defaultGuestUserNames)
Sets the user names who for this particular authentication system should be considered administrators by default. |
net.sf.acegisecurity.Authentication |
setGuestUserAsCurrentUser()
Set the guest user as the current user. |
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
|
void |
setPersonService(PersonService personService)
|
net.sf.acegisecurity.Authentication |
setSystemUserAsCurrentUser()
Set the system user as the current user note: for MT, will set to default domain only |
net.sf.acegisecurity.Authentication |
setSystemUserAsCurrentUser(java.lang.String tenantDomain)
Set the system user as the current user. |
void |
setTransactionService(TransactionService transactionService)
|
net.sf.acegisecurity.Authentication |
setUserDetails(net.sf.acegisecurity.UserDetails ud)
Explicitly set the given validated user details to be authenticated. |
void |
setUserRegistrySynchronizer(UserRegistrySynchronizer userRegistrySynchronizer)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractAuthenticationComponent()
Method Detail |
---|
public void setAllowGuestLogin(java.lang.Boolean allowGuestLogin)
allowGuestLogin
- public void setAuthenticationContext(AuthenticationContext authenticationContext)
public void setPersonService(PersonService personService)
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
public void setTransactionService(TransactionService transactionService)
public void setUserRegistrySynchronizer(UserRegistrySynchronizer userRegistrySynchronizer)
public TransactionService getTransactionService()
public java.lang.Boolean getAllowGuestLogin()
public org.alfresco.service.cmr.repository.NodeService getNodeService()
public PersonService getPersonService()
public void authenticate(java.lang.String userName, char[] password) throws org.alfresco.repo.security.authentication.AuthenticationException
AuthenticationComponent
authenticate
in interface AuthenticationComponent
AuthenticationException
protected void authenticateImpl(java.lang.String userName, char[] password)
userName
- password
- public net.sf.acegisecurity.Authentication setCurrentUser(java.lang.String userName) throws org.alfresco.repo.security.authentication.AuthenticationException
AuthenticationComponent
setCurrentUser
in interface AuthenticationComponent
org.alfresco.repo.security.authentication.AuthenticationException
public net.sf.acegisecurity.Authentication setCurrentUser(java.lang.String userName, AuthenticationComponent.UserNameValidationMode validationMode)
AuthenticationComponent
setCurrentUser
in interface AuthenticationComponent
protected net.sf.acegisecurity.UserDetails getUserDetails(java.lang.String userName)
userName
-
public net.sf.acegisecurity.Authentication setCurrentAuthentication(net.sf.acegisecurity.Authentication authentication)
cleared
.
setCurrentAuthentication
in interface AuthenticationContext
authentication
- the current authentication (may be null).
public net.sf.acegisecurity.Authentication getCurrentAuthentication() throws org.alfresco.repo.security.authentication.AuthenticationException
getCurrentAuthentication
in interface AuthenticationContext
AuthenticationException
public java.lang.String getCurrentUserName() throws org.alfresco.repo.security.authentication.AuthenticationException
getCurrentUserName
in interface AuthenticationContext
AuthenticationException
public net.sf.acegisecurity.Authentication setSystemUserAsCurrentUser()
setSystemUserAsCurrentUser
in interface AuthenticationContext
public java.lang.String getSystemUserName()
getSystemUserName
in interface AuthenticationContext
public boolean isSystemUserName(java.lang.String userName)
isSystemUserName
in interface AuthenticationContext
public boolean isCurrentUserTheSystemUser()
isCurrentUserTheSystemUser
in interface AuthenticationContext
public java.lang.String getGuestUserName()
getGuestUserName
in interface AuthenticationContext
public java.lang.String getGuestUserName(java.lang.String tenantDomain)
AuthenticationContext
getGuestUserName
in interface AuthenticationContext
public net.sf.acegisecurity.Authentication setGuestUserAsCurrentUser() throws org.alfresco.repo.security.authentication.AuthenticationException
setGuestUserAsCurrentUser
in interface AuthenticationComponent
org.alfresco.repo.security.authentication.AuthenticationException
public boolean isGuestUserName(java.lang.String userName)
AuthenticationContext
isGuestUserName
in interface AuthenticationContext
protected abstract boolean implementationAllowsGuestLogin()
public boolean guestUserAuthenticationAllowed()
AuthenticationComponent
guestUserAuthenticationAllowed
in interface AuthenticationComponent
public void clearCurrentSecurityContext()
clearCurrentSecurityContext
in interface AuthenticationContext
public java.util.Set getDefaultAdministratorUserNames()
getDefaultAdministratorUserNames
in interface AuthenticationComponent
public void setDefaultAdministratorUserNames(java.util.Set defaultAdministratorUserNames)
defaultAdministratorUserNames
- a set of user namespublic void setDefaultAdministratorUserNameList(java.lang.String defaultAdministratorUserNames)
defaultAdministratorUserNames
- public java.util.Set getDefaultGuestUserNames()
getDefaultGuestUserNames
in interface AuthenticationComponent
public void setDefaultGuestUserNames(java.util.Set defaultGuestUserNames)
defaultAdministratorUserNames
- a set of user namespublic void setDefaultGuestUserNameList(java.lang.String defaultGuestUserNames)
defaultAdministratorUserNames
- public java.lang.String getSystemUserName(java.lang.String tenantDomain)
AuthenticationContext
getSystemUserName
in interface AuthenticationContext
public java.lang.String getUserDomain(java.lang.String userName)
AuthenticationContext
getUserDomain
in interface AuthenticationContext
userName
- a user name
public net.sf.acegisecurity.Authentication setSystemUserAsCurrentUser(java.lang.String tenantDomain)
AuthenticationContext
setSystemUserAsCurrentUser
in interface AuthenticationContext
public net.sf.acegisecurity.Authentication setUserDetails(net.sf.acegisecurity.UserDetails ud)
AuthenticationContext
setUserDetails
in interface AuthenticationContext
ud
- the User Details
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |