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
AuthenticationComponent
authenticate
in interface AuthenticationComponent
AuthenticationException
protected void authenticateImpl(String userName, char[] password)
userName
- Stringpassword
- char[]public net.sf.acegisecurity.Authentication setCurrentUser(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(String userName, AuthenticationComponent.UserNameValidationMode validationMode)
AuthenticationComponent
setCurrentUser
in interface AuthenticationComponent
protected net.sf.acegisecurity.UserDetails getUserDetails(String userName)
userName
- Stringpublic net.sf.acegisecurity.Authentication setCurrentAuthentication(net.sf.acegisecurity.Authentication authentication)
AuthenticationContext
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 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 String getSystemUserName()
getSystemUserName
in interface AuthenticationContext
public boolean isSystemUserName(String userName)
isSystemUserName
in interface AuthenticationContext
public boolean isCurrentUserTheSystemUser()
isCurrentUserTheSystemUser
in interface AuthenticationContext
public String getGuestUserName()
getGuestUserName
in interface AuthenticationContext
public String getGuestUserName(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(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 Set<String> getDefaultAdministratorUserNames()
getDefaultAdministratorUserNames
in interface AuthenticationComponent
public void setDefaultAdministratorUserNames(Set<String> defaultAdministratorUserNames)
defaultAdministratorUserNames
- a set of user namespublic void setDefaultAdministratorUserNameList(String defaultAdministratorUserNames)
defaultAdministratorUserNames
- Stringpublic Set<String> getDefaultGuestUserNames()
AuthenticationComponent
getDefaultGuestUserNames
in interface AuthenticationComponent
public void setDefaultGuestUserNames(Set<String> defaultGuestUserNames)
defaultGuestUserNames
- a set of user namespublic void setDefaultGuestUserNameList(String defaultGuestUserNames)
defaultGuestUserNames
- Stringpublic String getSystemUserName(String tenantDomain)
AuthenticationContext
getSystemUserName
in interface AuthenticationContext
public String getUserDomain(String userName)
AuthenticationContext
getUserDomain
in interface AuthenticationContext
userName
- a user namepublic net.sf.acegisecurity.Authentication setSystemUserAsCurrentUser(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 Detailsprotected void onAuthenticate()
protected void onFail()
public int getNumberSuccessfulAuthentications()
public int getNumberFailedAuthentications()
Copyright © 2005–2017 Alfresco Software. All rights reserved.