Interface AuthenticationService
-
- All Known Subinterfaces:
MutableAuthenticationService
- All Known Implementing Classes:
AbstractAuthenticationService,AbstractChainingAuthenticationService,AuthenticationServiceImpl,ChainingAuthenticationServiceImpl,MutableAuthenticationServiceImpl,SubsystemChainingAuthenticationService
@AlfrescoPublicApi public interface AuthenticationServiceThe authentication service defines the API for managing authentication information against a user id.- Author:
- Andy Hind
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidauthenticate(java.lang.String userName, char[] password)Carry out an authentication attempt.voidauthenticateAsGuest()Authenticate as the guest user.booleanauthenticationExists(java.lang.String userName)Check if the given authentication exists.voidclearCurrentSecurityContext()Remove the current security informationbooleangetAuthenticationEnabled(java.lang.String userName)Is an authentication enabled or disabled?java.lang.StringgetCurrentTicket()Get the current ticket as a stringjava.lang.StringgetCurrentUserName()Get the name of the currently authenticated user.java.util.Set<java.lang.String>getDefaultAdministratorUserNames()Gets a set of user names who should be considered 'administrators' by default.java.util.Set<java.lang.String>getDefaultGuestUserNames()Gets a set of user names who should be considered 'guests' by default.java.util.Set<java.lang.String>getDomains()Get the domain to which this instance of an authentication service applies.java.util.Set<java.lang.String>getDomainsThatAllowUserCreation()Does this instance alow user to be created?java.util.Set<java.lang.String>getDomainsThatAllowUserDeletion()Does this instance allow users to be deleted?java.util.Set<java.lang.String>getDomiansThatAllowUserPasswordChanges()Does this instance allow users to update their passwords?java.lang.StringgetNewTicket()Get a new ticket as a stringbooleanguestUserAuthenticationAllowed()Check if Guest user authentication is allowed.voidinvalidateTicket(java.lang.String ticket)Invalidate a single ticket by IDvoidinvalidateUserSession(java.lang.String userName)Invalidate any tickets held by the user.booleanisCurrentUserTheSystemUser()Is the current user the system user?voidvalidate(java.lang.String ticket)Validate a ticket.
-
-
-
Method Detail
-
getAuthenticationEnabled
@Auditable(parameters="userName") boolean getAuthenticationEnabled(java.lang.String userName) throws org.alfresco.repo.security.authentication.AuthenticationExceptionIs an authentication enabled or disabled?- Throws:
org.alfresco.repo.security.authentication.AuthenticationException
-
authenticate
@Auditable(parameters={"userName","password"}, recordable={true,false}) void authenticate(java.lang.String userName, char[] password) throws org.alfresco.repo.security.authentication.AuthenticationExceptionCarry out an authentication attempt. If successful the user is set to the current user. The current user is a part of the thread context.- Parameters:
userName- the usernamepassword- the passowrd- Throws:
org.alfresco.repo.security.authentication.AuthenticationException
-
authenticateAsGuest
@Auditable void authenticateAsGuest() throws org.alfresco.repo.security.authentication.AuthenticationExceptionAuthenticate as the guest user. This may not be allowed and throw an exception.- Throws:
org.alfresco.repo.security.authentication.AuthenticationException
-
guestUserAuthenticationAllowed
@Auditable boolean guestUserAuthenticationAllowed()
Check if Guest user authentication is allowed.- Returns:
- true if Guest user authentication is allowed, false otherwise
-
authenticationExists
@Auditable(parameters="userName") boolean authenticationExists(java.lang.String userName)
Check if the given authentication exists.- Parameters:
userName- the username- Returns:
- Returns true if the authentication exists
-
getCurrentUserName
@Auditable java.lang.String getCurrentUserName() throws org.alfresco.repo.security.authentication.AuthenticationExceptionGet the name of the currently authenticated user.- Returns:
- String
- Throws:
org.alfresco.repo.security.authentication.AuthenticationException
-
invalidateUserSession
@Auditable(parameters="userName") void invalidateUserSession(java.lang.String userName) throws org.alfresco.repo.security.authentication.AuthenticationExceptionInvalidate any tickets held by the user.- Throws:
org.alfresco.repo.security.authentication.AuthenticationException
-
invalidateTicket
@Auditable(parameters="ticket", recordable=false) void invalidateTicket(java.lang.String ticket) throws org.alfresco.repo.security.authentication.AuthenticationExceptionInvalidate a single ticket by ID- Parameters:
ticket- String- Throws:
org.alfresco.repo.security.authentication.AuthenticationException
-
validate
@Auditable(parameters="ticket", recordable=false) void validate(java.lang.String ticket) throws org.alfresco.repo.security.authentication.AuthenticationExceptionValidate a ticket. Set the current user name accordingly.- Parameters:
ticket- String- Throws:
org.alfresco.repo.security.authentication.AuthenticationException
-
getCurrentTicket
@Auditable java.lang.String getCurrentTicket()
Get the current ticket as a string- Returns:
- String
-
getNewTicket
@Auditable java.lang.String getNewTicket()
Get a new ticket as a string- Returns:
- String
-
clearCurrentSecurityContext
@Auditable void clearCurrentSecurityContext()
Remove the current security information
-
isCurrentUserTheSystemUser
@Auditable boolean isCurrentUserTheSystemUser()
Is the current user the system user?
-
getDomains
@Auditable java.util.Set<java.lang.String> getDomains()
Get the domain to which this instance of an authentication service applies.- Returns:
- The domain name
-
getDomainsThatAllowUserCreation
@Auditable java.util.Set<java.lang.String> getDomainsThatAllowUserCreation()
Does this instance alow user to be created?
-
getDomainsThatAllowUserDeletion
@Auditable java.util.Set<java.lang.String> getDomainsThatAllowUserDeletion()
Does this instance allow users to be deleted?
-
getDomiansThatAllowUserPasswordChanges
@Auditable java.util.Set<java.lang.String> getDomiansThatAllowUserPasswordChanges()
Does this instance allow users to update their passwords?
-
getDefaultAdministratorUserNames
@Auditable java.util.Set<java.lang.String> getDefaultAdministratorUserNames()
Gets a set of user names who should be considered 'administrators' by default.- Returns:
- a set of user names
-
getDefaultGuestUserNames
@Auditable java.util.Set<java.lang.String> getDefaultGuestUserNames()
Gets a set of user names who should be considered 'guests' by default.- Returns:
- a set of user names
-
-