public abstract class AbstractChainingAuthenticationService extends AbstractAuthenticationService implements MutableAuthenticationService
AuthenticationService instances, as returned by getUsableAuthenticationServices().GUEST_AUTHENTICATION_NOT_SUPPORTED| Constructor and Description |
|---|
AbstractChainingAuthenticationService()
Instantiates a new abstract chaining authentication service.
|
| Modifier and Type | Method and Description |
|---|---|
void |
authenticate(String userName,
char[] password)
Carry out an authentication attempt.
|
void |
authenticateAsGuest()
Authenticate as the guest user.
|
boolean |
authenticationExists(String userName)
Check if the given authentication exists.
|
void |
clearCurrentSecurityContext()
Remove the current security information
|
int |
countTickets(boolean nonExpiredOnly) |
void |
createAuthentication(String userName,
char[] password)
Create an authentication for the given user.
|
void |
deleteAuthentication(String userName)
Delete an authentication entry
|
boolean |
getAuthenticationEnabled(String userName)
Is an authentication enabled or disabled?
|
String |
getCurrentTicket()
Get the current ticket as a string
|
String |
getCurrentUserName()
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?
|
protected String |
getId(AuthenticationService authService)
Should be overridden to returns the ID of the authService for use in debug.
|
abstract MutableAuthenticationService |
getMutableAuthenticationService()
Gets the mutable authentication service.
|
String |
getNewTicket()
Get a new ticket as a string
|
Set<TicketComponent> |
getTicketComponents() |
protected abstract List<AuthenticationService> |
getUsableAuthenticationServices()
Gets the authentication services across which methods will chain.
|
Set<String> |
getUsersWithTickets(boolean nonExpiredOnly) |
boolean |
guestUserAuthenticationAllowed()
Check if Guest user authentication is allowed.
|
void |
invalidateTicket(String ticket)
Invalidate a single ticket by ID
|
int |
invalidateTickets(boolean nonExpiredOnly) |
void |
invalidateUserSession(String userName)
Invalidate any tickets held by the user.
|
boolean |
isAuthenticationCreationAllowed()
Determines whether authentication creation is allowed.
|
boolean |
isAuthenticationMutable(String userName)
Determines whether this user's authentication may be mutated via the other methods.
|
boolean |
isCurrentUserTheSystemUser()
Is the current user the system user?
|
void |
setAuthentication(String userName,
char[] newPassword)
Set the login information for a user (typically called by an admin user)
|
void |
setAuthenticationEnabled(String userName,
boolean enabled)
Enable or disable an authentication entry
|
void |
updateAuthentication(String userName,
char[] oldPassword,
char[] newPassword)
Update the login information for the user (typically called by the user)
|
void |
validate(String ticket)
Validate a ticket.
|
getAllowedUsers, getMaxUsers, preAuthenticationCheck, setSysAdminParamspublic AbstractChainingAuthenticationService()
public abstract MutableAuthenticationService getMutableAuthenticationService()
protected abstract List<AuthenticationService> getUsableAuthenticationServices()
public void createAuthentication(String userName, char[] password) throws AuthenticationException
MutableAuthenticationServicecreateAuthentication in interface MutableAuthenticationServiceuserName - Stringpassword - char[]AuthenticationExceptionpublic void updateAuthentication(String userName, char[] oldPassword, char[] newPassword) throws AuthenticationException
MutableAuthenticationServiceupdateAuthentication in interface MutableAuthenticationServiceuserName - StringoldPassword - char[]newPassword - char[]AuthenticationExceptionpublic void setAuthentication(String userName, char[] newPassword) throws AuthenticationException
setAuthentication in interface MutableAuthenticationServiceuserName - StringnewPassword - char[]AuthenticationExceptionpublic void deleteAuthentication(String userName) throws AuthenticationException
deleteAuthentication in interface MutableAuthenticationServiceuserName - StringAuthenticationExceptionpublic void setAuthenticationEnabled(String userName, boolean enabled) throws AuthenticationException
setAuthenticationEnabled in interface MutableAuthenticationServiceuserName - Stringenabled - booleanAuthenticationExceptionpublic boolean isAuthenticationMutable(String userName)
isAuthenticationMutable in interface MutableAuthenticationServiceuserName - the user IDtrue if this user's authentication may be mutated via the other methods.public boolean isAuthenticationCreationAllowed()
isAuthenticationCreationAllowed in interface MutableAuthenticationServicetrue if authentication creation is allowedpublic boolean getAuthenticationEnabled(String userName) throws AuthenticationException
getAuthenticationEnabled in interface AuthenticationServiceAuthenticationExceptionpublic void authenticate(String userName, char[] password) throws AuthenticationException
authenticate in interface AuthenticationServiceuserName - the usernamepassword - the passowrdAuthenticationExceptionprotected String getId(AuthenticationService authService)
authService - in question.public void authenticateAsGuest()
throws AuthenticationException
authenticateAsGuest in interface AuthenticationServiceAuthenticationExceptionpublic boolean guestUserAuthenticationAllowed()
guestUserAuthenticationAllowed in interface AuthenticationServicepublic boolean authenticationExists(String userName)
authenticationExists in interface AuthenticationServiceuserName - the usernamepublic String getCurrentUserName() throws AuthenticationException
getCurrentUserName in interface AuthenticationServiceAuthenticationExceptionpublic void invalidateUserSession(String userName) throws AuthenticationException
invalidateUserSession in interface AuthenticationServiceAuthenticationExceptionpublic void invalidateTicket(String ticket) throws AuthenticationException
invalidateTicket in interface AuthenticationServiceticket - StringAuthenticationExceptionpublic void validate(String ticket) throws AuthenticationException
validate in interface AuthenticationServiceticket - StringAuthenticationExceptionpublic String getCurrentTicket()
getCurrentTicket in interface AuthenticationServicepublic String getNewTicket()
getNewTicket in interface AuthenticationServicepublic void clearCurrentSecurityContext()
clearCurrentSecurityContext in interface AuthenticationServicepublic boolean isCurrentUserTheSystemUser()
isCurrentUserTheSystemUser in interface AuthenticationServicepublic Set<String> getDomains()
getDomains in interface AuthenticationServicepublic Set<String> getDomainsThatAllowUserCreation()
getDomainsThatAllowUserCreation in interface AuthenticationServicepublic Set<String> getDomainsThatAllowUserDeletion()
getDomainsThatAllowUserDeletion in interface AuthenticationServicepublic Set<String> getDomiansThatAllowUserPasswordChanges()
getDomiansThatAllowUserPasswordChanges in interface AuthenticationServicepublic Set<String> getUsersWithTickets(boolean nonExpiredOnly)
getUsersWithTickets in class AbstractAuthenticationServicepublic int countTickets(boolean nonExpiredOnly)
countTickets in class AbstractAuthenticationServicepublic int invalidateTickets(boolean nonExpiredOnly)
invalidateTickets in class AbstractAuthenticationServicepublic Set<TicketComponent> getTicketComponents()
getTicketComponents in class AbstractAuthenticationServicepublic Set<String> getDefaultAdministratorUserNames()
getDefaultAdministratorUserNames in interface AuthenticationServicepublic Set<String> getDefaultGuestUserNames()
getDefaultGuestUserNames in interface AuthenticationServiceCopyright © 2005–2020 Alfresco Software. All rights reserved.