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<org.alfresco.repo.security.authentication.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, setSysAdminParams
public AbstractChainingAuthenticationService()
public abstract MutableAuthenticationService getMutableAuthenticationService()
protected abstract List<AuthenticationService> getUsableAuthenticationServices()
public void createAuthentication(String userName, char[] password) throws org.alfresco.repo.security.authentication.AuthenticationException
MutableAuthenticationService
createAuthentication
in interface MutableAuthenticationService
userName
- Stringpassword
- char[]org.alfresco.repo.security.authentication.AuthenticationException
public void updateAuthentication(String userName, char[] oldPassword, char[] newPassword) throws org.alfresco.repo.security.authentication.AuthenticationException
MutableAuthenticationService
updateAuthentication
in interface MutableAuthenticationService
userName
- StringoldPassword
- char[]newPassword
- char[]org.alfresco.repo.security.authentication.AuthenticationException
public void setAuthentication(String userName, char[] newPassword) throws org.alfresco.repo.security.authentication.AuthenticationException
setAuthentication
in interface MutableAuthenticationService
userName
- StringnewPassword
- char[]org.alfresco.repo.security.authentication.AuthenticationException
public void deleteAuthentication(String userName) throws org.alfresco.repo.security.authentication.AuthenticationException
deleteAuthentication
in interface MutableAuthenticationService
userName
- Stringorg.alfresco.repo.security.authentication.AuthenticationException
public void setAuthenticationEnabled(String userName, boolean enabled) throws org.alfresco.repo.security.authentication.AuthenticationException
setAuthenticationEnabled
in interface MutableAuthenticationService
userName
- Stringenabled
- booleanorg.alfresco.repo.security.authentication.AuthenticationException
public boolean isAuthenticationMutable(String userName)
isAuthenticationMutable
in interface MutableAuthenticationService
userName
- the user IDtrue
if this user's authentication may be mutated via the other methods.public boolean isAuthenticationCreationAllowed()
isAuthenticationCreationAllowed
in interface MutableAuthenticationService
true
if authentication creation is allowedpublic boolean getAuthenticationEnabled(String userName) throws org.alfresco.repo.security.authentication.AuthenticationException
getAuthenticationEnabled
in interface AuthenticationService
org.alfresco.repo.security.authentication.AuthenticationException
public void authenticate(String userName, char[] password) throws org.alfresco.repo.security.authentication.AuthenticationException
authenticate
in interface AuthenticationService
userName
- the usernamepassword
- the passowrdorg.alfresco.repo.security.authentication.AuthenticationException
protected String getId(AuthenticationService authService)
authService
- in question.public void authenticateAsGuest() throws org.alfresco.repo.security.authentication.AuthenticationException
authenticateAsGuest
in interface AuthenticationService
org.alfresco.repo.security.authentication.AuthenticationException
public boolean guestUserAuthenticationAllowed()
guestUserAuthenticationAllowed
in interface AuthenticationService
public boolean authenticationExists(String userName)
authenticationExists
in interface AuthenticationService
userName
- the usernamepublic String getCurrentUserName() throws org.alfresco.repo.security.authentication.AuthenticationException
getCurrentUserName
in interface AuthenticationService
org.alfresco.repo.security.authentication.AuthenticationException
public void invalidateUserSession(String userName) throws org.alfresco.repo.security.authentication.AuthenticationException
invalidateUserSession
in interface AuthenticationService
org.alfresco.repo.security.authentication.AuthenticationException
public void invalidateTicket(String ticket) throws org.alfresco.repo.security.authentication.AuthenticationException
invalidateTicket
in interface AuthenticationService
ticket
- Stringorg.alfresco.repo.security.authentication.AuthenticationException
public void validate(String ticket) throws org.alfresco.repo.security.authentication.AuthenticationException
validate
in interface AuthenticationService
ticket
- Stringorg.alfresco.repo.security.authentication.AuthenticationException
public String getCurrentTicket()
getCurrentTicket
in interface AuthenticationService
public String getNewTicket()
getNewTicket
in interface AuthenticationService
public void clearCurrentSecurityContext()
clearCurrentSecurityContext
in interface AuthenticationService
public boolean isCurrentUserTheSystemUser()
isCurrentUserTheSystemUser
in interface AuthenticationService
public Set<String> getDomains()
getDomains
in interface AuthenticationService
public Set<String> getDomainsThatAllowUserCreation()
getDomainsThatAllowUserCreation
in interface AuthenticationService
public Set<String> getDomainsThatAllowUserDeletion()
getDomainsThatAllowUserDeletion
in interface AuthenticationService
public Set<String> getDomiansThatAllowUserPasswordChanges()
getDomiansThatAllowUserPasswordChanges
in interface AuthenticationService
public Set<String> getUsersWithTickets(boolean nonExpiredOnly)
getUsersWithTickets
in class AbstractAuthenticationService
public int countTickets(boolean nonExpiredOnly)
countTickets
in class AbstractAuthenticationService
public int invalidateTickets(boolean nonExpiredOnly)
invalidateTickets
in class AbstractAuthenticationService
public Set<org.alfresco.repo.security.authentication.TicketComponent> getTicketComponents()
getTicketComponents
in class AbstractAuthenticationService
public Set<String> getDefaultAdministratorUserNames()
getDefaultAdministratorUserNames
in interface AuthenticationService
public Set<String> getDefaultGuestUserNames()
getDefaultGuestUserNames
in interface AuthenticationService
Copyright © 2005–2017 Alfresco Software. All rights reserved.