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
Modifier and TypeMethodDescriptionvoidauthenticate(String userName, char[] password) Carry out an authentication attempt.voidAuthenticate as the guest user.booleanauthenticationExists(String userName) Check if the given authentication exists.voidRemove the current security informationbooleangetAuthenticationEnabled(String userName) Is an authentication enabled or disabled?Get the current ticket as a stringGet the name of the currently authenticated user.Gets a set of user names who should be considered 'administrators' by default.Gets a set of user names who should be considered 'guests' by default.Get the domain to which this instance of an authentication service applies.Does this instance alow user to be created?Does this instance allow users to be deleted?Does this instance allow users to update their passwords?Get a new ticket as a stringbooleanCheck if Guest user authentication is allowed.voidinvalidateTicket(String ticket) Invalidate a single ticket by IDvoidinvalidateUserSession(String userName) Invalidate any tickets held by the user.booleanIs the current user the system user?voidValidate a ticket.
-
Method Details
-
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
Authenticate as the guest user. This may not be allowed and throw an exception.- Throws:
AuthenticationException
-
guestUserAuthenticationAllowed
Check if Guest user authentication is allowed.- Returns:
- true if Guest user authentication is allowed, false otherwise
-
authenticationExists
Check if the given authentication exists.- Parameters:
userName- the username- Returns:
- Returns true if the authentication exists
-
getCurrentUserName
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
Get the current ticket as a string- Returns:
- String
-
getNewTicket
Get a new ticket as a string- Returns:
- String
-
clearCurrentSecurityContext
Remove the current security information -
isCurrentUserTheSystemUser
Is the current user the system user? -
getDomains
Get the domain to which this instance of an authentication service applies.- Returns:
- The domain name
-
getDomainsThatAllowUserCreation
Does this instance alow user to be created? -
getDomainsThatAllowUserDeletion
Does this instance allow users to be deleted? -
getDomiansThatAllowUserPasswordChanges
Does this instance allow users to update their passwords? -
getDefaultAdministratorUserNames
Gets a set of user names who should be considered 'administrators' by default.- Returns:
- a set of user names
-
getDefaultGuestUserNames
Gets a set of user names who should be considered 'guests' by default.- Returns:
- a set of user names
-