org.alfresco.service.cmr.security
Interface AuthenticationService

All Known Subinterfaces:
MutableAuthenticationService
All Known Implementing Classes:
AbstractAuthenticationService, AbstractChainingAuthenticationService, AuthenticationServiceImpl, ChainingAuthenticationServiceImpl, MutableAuthenticationServiceImpl, SubsystemChainingAuthenticationService, TestAuthenticationServiceImpl

public interface AuthenticationService

The authentication service defines the API for managing authentication information against a user id.


Method Summary
 void authenticate(java.lang.String userName, char[] password)
          Carry out an authentication attempt.
 void authenticateAsGuest()
          Authenticate as the guest user.
 boolean authenticationExists(java.lang.String userName)
          Check if the given authentication exists.
 void clearCurrentSecurityContext()
          Remove the current security information
 boolean getAuthenticationEnabled(java.lang.String userName)
          Is an authentication enabled or disabled?
 java.lang.String getCurrentTicket()
          Get the current ticket as a string
 java.lang.String getCurrentUserName()
          Get the name of the currently authenticated user.
 java.util.Set getDefaultAdministratorUserNames()
          Gets a set of user names who should be considered 'administrators' by default.
 java.util.Set getDefaultGuestUserNames()
          Gets a set of user names who should be considered 'guests' by default.
 java.util.Set getDomains()
          Get the domain to which this instance of an authentication service applies.
 java.util.Set getDomainsThatAllowUserCreation()
          Does this instance alow user to be created?
 java.util.Set getDomainsThatAllowUserDeletion()
          Does this instance allow users to be deleted?
 java.util.Set getDomiansThatAllowUserPasswordChanges()
          Does this instance allow users to update their passwords?
 java.lang.String getNewTicket()
          Get a new ticket as a string
 boolean guestUserAuthenticationAllowed()
          Check if Guest user authentication is allowed.
 void invalidateTicket(java.lang.String ticket)
          Invalidate a single ticket by ID
 void invalidateUserSession(java.lang.String userName)
          Invalidate any tickets held by the user.
 boolean isCurrentUserTheSystemUser()
          Is the current user the system user?
 void validate(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.AuthenticationException
Is 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.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 username
password - the passowrd
Throws:
org.alfresco.repo.security.authentication.AuthenticationException

authenticateAsGuest

@Auditable
void authenticateAsGuest()
                         throws org.alfresco.repo.security.authentication.AuthenticationException
Authenticate 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.AuthenticationException
Get the name of the currently authenticated user.

Returns:
Throws:
org.alfresco.repo.security.authentication.AuthenticationException

invalidateUserSession

@Auditable(parameters="userName")
void invalidateUserSession(java.lang.String userName)
                           throws org.alfresco.repo.security.authentication.AuthenticationException
Invalidate 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.AuthenticationException
Invalidate a single ticket by ID

Parameters:
ticket -
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.AuthenticationException
Validate a ticket. Set the current user name accordingly.

Parameters:
ticket -
Throws:
org.alfresco.repo.security.authentication.AuthenticationException

getCurrentTicket

@Auditable
java.lang.String getCurrentTicket()
Get the current ticket as a string

Returns:

getNewTicket

@Auditable
java.lang.String getNewTicket()
Get a new ticket as a string

Returns:

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 getDomains()
Get the domain to which this instance of an authentication service applies.

Returns:
The domain name

getDomainsThatAllowUserCreation

@Auditable
java.util.Set getDomainsThatAllowUserCreation()
Does this instance alow user to be created?


getDomainsThatAllowUserDeletion

@Auditable
java.util.Set getDomainsThatAllowUserDeletion()
Does this instance allow users to be deleted?


getDomiansThatAllowUserPasswordChanges

@Auditable
java.util.Set getDomiansThatAllowUserPasswordChanges()
Does this instance allow users to update their passwords?


getDefaultAdministratorUserNames

@Auditable
java.util.Set 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 getDefaultGuestUserNames()
Gets a set of user names who should be considered 'guests' by default.

Returns:
a set of user names


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.