public abstract class AbstractAuthenticationComponent extends Object implements AuthenticationComponent
AuthenticationComponent.UserNameValidationMode| Constructor and Description |
|---|
AbstractAuthenticationComponent() |
| Modifier and Type | Method and Description |
|---|---|
void |
authenticate(String userName,
char[] password)
Authenticate
|
protected void |
authenticateImpl(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
|
Boolean |
getAllowGuestLogin() |
net.sf.acegisecurity.Authentication |
getCurrentAuthentication()
Get the current authentication context
|
String |
getCurrentUserName()
Get the current user name.
|
Set<String> |
getDefaultAdministratorUserNames()
Gets a set of user names who for this particular authentication system should be considered administrators by
default.
|
Set<String> |
getDefaultGuestUserNames()
Gets a set of user names who for this particular authentication system should be considered guests by
default.
|
String |
getGuestUserName()
Get the name of the Guest User note: for MT, will get guest for default domain only
|
String |
getGuestUserName(String tenantDomain)
Get the name of the guest user
|
org.alfresco.service.cmr.repository.NodeService |
getNodeService() |
int |
getNumberFailedAuthentications() |
int |
getNumberSuccessfulAuthentications() |
PersonService |
getPersonService() |
String |
getSystemUserName()
Get the name of the system user note: for MT, will get system for default domain only
|
String |
getSystemUserName(String tenantDomain)
Get the name of the system user
|
TransactionService |
getTransactionService() |
protected net.sf.acegisecurity.UserDetails |
getUserDetails(String userName)
Default implementation that makes an ACEGI object on the fly
|
String |
getUserDomain(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(String userName)
True if this is a guest user ?
|
boolean |
isSystemUserName(String userName)
Is this the system user ?
|
protected void |
onAuthenticate() |
protected void |
onFail() |
void |
setAllowGuestLogin(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(String userName)
Explicitly set the current user to be authenticated.
|
net.sf.acegisecurity.Authentication |
setCurrentUser(String userName,
AuthenticationComponent.UserNameValidationMode validationMode)
Explicitly set the current user to be authenticated.
|
void |
setDefaultAdministratorUserNameList(String defaultAdministratorUserNames)
Convenience method to allow the administrator user names to be specified as a comma separated list
|
void |
setDefaultAdministratorUserNames(Set<String> defaultAdministratorUserNames)
Sets the user names who for this particular authentication system should be considered administrators by default.
|
void |
setDefaultGuestUserNameList(String defaultGuestUserNames)
Convenience method to allow the administrator user names to be specified as a comma separated list
|
void |
setDefaultGuestUserNames(Set<String> 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(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) |
public void setAllowGuestLogin(Boolean allowGuestLogin)
allowGuestLogin - Booleanpublic 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 Boolean getAllowGuestLogin()
public org.alfresco.service.cmr.repository.NodeService getNodeService()
public PersonService getPersonService()
public void authenticate(String userName, char[] password) throws org.alfresco.repo.security.authentication.AuthenticationException
AuthenticationComponentauthenticate in interface AuthenticationComponentAuthenticationExceptionprotected void authenticateImpl(String userName, char[] password)
userName - Stringpassword - char[]public net.sf.acegisecurity.Authentication setCurrentUser(String userName) throws org.alfresco.repo.security.authentication.AuthenticationException
AuthenticationComponentsetCurrentUser in interface AuthenticationComponentorg.alfresco.repo.security.authentication.AuthenticationExceptionpublic net.sf.acegisecurity.Authentication setCurrentUser(String userName, AuthenticationComponent.UserNameValidationMode validationMode)
AuthenticationComponentsetCurrentUser in interface AuthenticationComponentprotected net.sf.acegisecurity.UserDetails getUserDetails(String userName)
userName - Stringpublic net.sf.acegisecurity.Authentication setCurrentAuthentication(net.sf.acegisecurity.Authentication authentication)
AuthenticationContextcleared.setCurrentAuthentication in interface AuthenticationContextauthentication - the current authentication (may be null).public net.sf.acegisecurity.Authentication getCurrentAuthentication()
throws org.alfresco.repo.security.authentication.AuthenticationException
getCurrentAuthentication in interface AuthenticationContextAuthenticationExceptionpublic String getCurrentUserName() throws org.alfresco.repo.security.authentication.AuthenticationException
getCurrentUserName in interface AuthenticationContextAuthenticationExceptionpublic net.sf.acegisecurity.Authentication setSystemUserAsCurrentUser()
setSystemUserAsCurrentUser in interface AuthenticationContextpublic String getSystemUserName()
getSystemUserName in interface AuthenticationContextpublic boolean isSystemUserName(String userName)
isSystemUserName in interface AuthenticationContextpublic boolean isCurrentUserTheSystemUser()
isCurrentUserTheSystemUser in interface AuthenticationContextpublic String getGuestUserName()
getGuestUserName in interface AuthenticationContextpublic String getGuestUserName(String tenantDomain)
AuthenticationContextgetGuestUserName in interface AuthenticationContextpublic net.sf.acegisecurity.Authentication setGuestUserAsCurrentUser()
throws org.alfresco.repo.security.authentication.AuthenticationException
setGuestUserAsCurrentUser in interface AuthenticationComponentorg.alfresco.repo.security.authentication.AuthenticationExceptionpublic boolean isGuestUserName(String userName)
AuthenticationContextisGuestUserName in interface AuthenticationContextprotected abstract boolean implementationAllowsGuestLogin()
public boolean guestUserAuthenticationAllowed()
AuthenticationComponentguestUserAuthenticationAllowed in interface AuthenticationComponentpublic void clearCurrentSecurityContext()
clearCurrentSecurityContext in interface AuthenticationContextpublic Set<String> getDefaultAdministratorUserNames()
getDefaultAdministratorUserNames in interface AuthenticationComponentpublic void setDefaultAdministratorUserNames(Set<String> defaultAdministratorUserNames)
defaultAdministratorUserNames - a set of user namespublic void setDefaultAdministratorUserNameList(String defaultAdministratorUserNames)
defaultAdministratorUserNames - Stringpublic Set<String> getDefaultGuestUserNames()
AuthenticationComponentgetDefaultGuestUserNames in interface AuthenticationComponentpublic void setDefaultGuestUserNames(Set<String> defaultGuestUserNames)
defaultGuestUserNames - a set of user namespublic void setDefaultGuestUserNameList(String defaultGuestUserNames)
defaultGuestUserNames - Stringpublic String getSystemUserName(String tenantDomain)
AuthenticationContextgetSystemUserName in interface AuthenticationContextpublic String getUserDomain(String userName)
AuthenticationContextgetUserDomain in interface AuthenticationContextuserName - a user namepublic net.sf.acegisecurity.Authentication setSystemUserAsCurrentUser(String tenantDomain)
AuthenticationContextsetSystemUserAsCurrentUser in interface AuthenticationContextpublic net.sf.acegisecurity.Authentication setUserDetails(net.sf.acegisecurity.UserDetails ud)
AuthenticationContextsetUserDetails in interface AuthenticationContextud - the User Detailsprotected void onAuthenticate()
protected void onFail()
public int getNumberSuccessfulAuthentications()
public int getNumberFailedAuthentications()
Copyright © 2005–2018 Alfresco Software. All rights reserved.