com.atlassian.crowd.service
Interface AuthenticationManager

All Known Implementing Classes:
CacheAwareAuthenticationManager, SimpleAuthenticationManager

public interface AuthenticationManager

Used by applications that only need user authentication and validation services.


Method Summary
 String authenticate(String username, String password)
          Authenticates a user, using just a username and password.
 String authenticate(UserAuthenticationContext authenticationContext)
          Authenticate a user.
 String authenticateWithoutValidatingPassword(UserAuthenticationContext authenticationContext)
          Authenticate a user without validating their password.
 SecurityServerClient getSecurityServerClient()
          Returns an instance of the SecurityServerClient, for when you need more API access than the authentication manager provides.
 void invalidate(String token)
          Marks the presented token as invalid, meaning that the principal it represents is no longer authenticated.
 boolean isAuthenticated(String token, ValidationFactor[] validationFactors)
          Checks that the token (as returned from authenticate() is still valid, given the validation factors.
 

Method Detail

authenticate

String authenticate(UserAuthenticationContext authenticationContext)
                    throws RemoteException,
                           InvalidAuthorizationTokenException,
                           InvalidAuthenticationException,
                           InactiveAccountException,
                           ApplicationAccessDeniedException,
                           ExpiredCredentialException
Authenticate a user. The PrincipalAuthenticationContext contains the details of who they are, the credentials they're presenting, and where they're coming from. If the authenticationContext does not contain application details, they will be added using details provided by the SecurityServerClient.

Parameters:
authenticationContext - The details of the user that is to be authenticated.
Returns:
Returns an authorization token if successful.
Throws:
RemoteException - A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.
InvalidAuthenticationException - The user was not successfully authenticated.
InactiveAccountException - The user's account is inactive and they are not be allowed to authenticate.
ExpiredCredentialException - The user's credentials have expired. The user must change their credentials in order to successfully authenticate.
ApplicationAccessDeniedException - user does not have authorisation to access application.

authenticateWithoutValidatingPassword

String authenticateWithoutValidatingPassword(UserAuthenticationContext authenticationContext)
                                             throws ApplicationAccessDeniedException,
                                                    InvalidAuthenticationException,
                                                    InvalidAuthorizationTokenException,
                                                    InactiveAccountException,
                                                    RemoteException
Authenticate a user without validating their password. The PrincipalAuthenticationContext contains the details of who they are and where they're coming from but does not need to contain any credentials.

Parameters:
authenticationContext - The details of the user that is to be authenticated. Username and validation factors are required.
Returns:
Returns an authorization token if successful.
Throws:
ApplicationAccessDeniedException - user does not have authorisation to access application.
InactiveAccountException - The user's account is inactive and they are not be allowed to authenticate.
InvalidAuthenticationException - The user was not successfully authenticated.
InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.
RemoteException - A communication error occurred - the Crowd server may not be available.

authenticate

String authenticate(String username,
                    String password)
                    throws RemoteException,
                           InvalidAuthorizationTokenException,
                           InvalidAuthenticationException,
                           InactiveAccountException,
                           ApplicationAccessDeniedException,
                           ExpiredCredentialException
Authenticates a user, using just a username and password.

Parameters:
username - username of user.
password - credentials of user.
Returns:
Returns an authorization token if successful.
Throws:
RemoteException - A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.
InvalidAuthenticationException - The user was not successfully authenticated.
InactiveAccountException - The user's account is inactive and they are not be allowed to authenticate.
ExpiredCredentialException - The user's credentials have expired.
ApplicationAccessDeniedException - user does not have authorisation to access application.

isAuthenticated

boolean isAuthenticated(String token,
                        ValidationFactor[] validationFactors)
                        throws RemoteException,
                               InvalidAuthorizationTokenException,
                               ApplicationAccessDeniedException,
                               InvalidAuthenticationException
Checks that the token (as returned from authenticate() is still valid, given the validation factors.

Parameters:
token - The token presented by the user as evidence of their authenticity
validationFactors - Details of where the user's come from. If presented, must match those presented during authentication.
Returns:
true if the user is still authenticated, false if not.
Throws:
RemoteException - A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.
ApplicationAccessDeniedException - user does not have authorisation to access application.
InvalidAuthenticationException - The user was not successfully authenticated.

invalidate

void invalidate(String token)
                throws RemoteException,
                       InvalidAuthorizationTokenException,
                       InvalidAuthenticationException
Marks the presented token as invalid, meaning that the principal it represents is no longer authenticated. Usually used to make the user logged-off.

Parameters:
token - The token presented by the user, as returned from authenticate()
Throws:
RemoteException - A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.
InvalidAuthenticationException - The user was not successfully authenticated.

getSecurityServerClient

SecurityServerClient getSecurityServerClient()
Returns an instance of the SecurityServerClient, for when you need more API access than the authentication manager provides.

Returns:
underlying SecurityServerClient.


Copyright © 2013 Atlassian. All Rights Reserved.