Interface AuthenticationService
-
- All Known Subinterfaces:
MutableAuthenticationService
- All Known Implementing Classes:
AbstractAuthenticationService,AbstractChainingAuthenticationService,AuthenticationServiceImpl,ChainingAuthenticationServiceImpl,MutableAuthenticationServiceImpl,SubsystemChainingAuthenticationService
@AlfrescoPublicApi public interface AuthenticationService
The 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(String userName, char[] password)Carry out an authentication attempt.voidauthenticateAsGuest()Authenticate as the guest user.booleanauthenticationExists(String userName)Check if the given authentication exists.voidclearCurrentSecurityContext()Remove the current security informationbooleangetAuthenticationEnabled(String userName)Is an authentication enabled or disabled?StringgetCurrentTicket()Get the current ticket as a stringStringgetCurrentUserName()Get the name of the currently authenticated user.Set<String>getDefaultAdministratorUserNames()Gets a set of user names who should be considered 'administrators' by default.Set<String>getDefaultGuestUserNames()Gets a set of user names who should be considered 'guests' by default.Set<String>getDomains()Get the domain to which this instance of an authentication service applies.Set<String>getDomainsThatAllowUserCreation()Does this instance alow user to be created?Set<String>getDomainsThatAllowUserDeletion()Does this instance allow users to be deleted?Set<String>getDomiansThatAllowUserPasswordChanges()Does this instance allow users to update their passwords?StringgetNewTicket()Get a new ticket as a stringbooleanguestUserAuthenticationAllowed()Check if Guest user authentication is allowed.voidinvalidateTicket(String ticket)Invalidate a single ticket by IDvoidinvalidateUserSession(String userName)Invalidate any tickets held by the user.booleanisCurrentUserTheSystemUser()Is the current user the system user?voidvalidate(String ticket)Validate a ticket.
-
-
-
Method Detail
-
getAuthenticationEnabled
@Auditable(parameters="userName") boolean getAuthenticationEnabled(String userName) throws AuthenticationException
Is an authentication enabled or disabled?- Throws:
AuthenticationException
-
authenticate
@Auditable(parameters={"userName","password"}, recordable={true,false}) void authenticate(String userName, char[] password) throws AuthenticationException
Carry 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:
AuthenticationException
-
authenticateAsGuest
@Auditable void authenticateAsGuest() throws AuthenticationException
Authenticate as the guest user. This may not be allowed and throw an exception.- Throws:
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(String userName)
Check if the given authentication exists.- Parameters:
userName- the username- Returns:
- Returns true if the authentication exists
-
getCurrentUserName
@Auditable String getCurrentUserName() throws AuthenticationException
Get the name of the currently authenticated user.- Returns:
- String
- Throws:
AuthenticationException
-
invalidateUserSession
@Auditable(parameters="userName") void invalidateUserSession(String userName) throws AuthenticationException
Invalidate any tickets held by the user.- Throws:
AuthenticationException
-
invalidateTicket
@Auditable(parameters="ticket", recordable=false) void invalidateTicket(String ticket) throws AuthenticationException
Invalidate a single ticket by ID- Parameters:
ticket- String- Throws:
AuthenticationException
-
validate
@Auditable(parameters="ticket", recordable=false) void validate(String ticket) throws AuthenticationException
Validate a ticket. Set the current user name accordingly.- Parameters:
ticket- String- Throws:
AuthenticationException
-
getCurrentTicket
@Auditable String getCurrentTicket()
Get the current ticket as a string- Returns:
- String
-
getNewTicket
@Auditable 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 Set<String> getDomains()
Get the domain to which this instance of an authentication service applies.- Returns:
- The domain name
-
getDomainsThatAllowUserCreation
@Auditable Set<String> getDomainsThatAllowUserCreation()
Does this instance alow user to be created?
-
getDomainsThatAllowUserDeletion
@Auditable Set<String> getDomainsThatAllowUserDeletion()
Does this instance allow users to be deleted?
-
getDomiansThatAllowUserPasswordChanges
@Auditable Set<String> getDomiansThatAllowUserPasswordChanges()
Does this instance allow users to update their passwords?
-
getDefaultAdministratorUserNames
@Auditable Set<String> getDefaultAdministratorUserNames()
Gets a set of user names who should be considered 'administrators' by default.- Returns:
- a set of user names
-
getDefaultGuestUserNames
@Auditable Set<String> getDefaultGuestUserNames()
Gets a set of user names who should be considered 'guests' by default.- Returns:
- a set of user names
-
-