com.atlassian.crowd.integration.service.cache
Class AuthenticationManagerImpl

java.lang.Object
  extended by com.atlassian.crowd.integration.service.cache.AuthenticationManagerImpl
All Implemented Interfaces:
AuthenticationManager

public class AuthenticationManagerImpl
extends java.lang.Object
implements AuthenticationManager

This class provides a version of the AuthenticationManager interface that, at least initially, will not perform caching. The abstraction is in place so we can decouple client-side code from the SecurityServerClient. It also serves to logically break out the API.


Constructor Summary
AuthenticationManagerImpl(SecurityServerClient securityServerClient)
           
 
Method Summary
 java.lang.String authenticate(PrincipalAuthenticationContext authenticationContext)
          Authenticate a user.
 java.lang.String authenticate(java.lang.String username, java.lang.String password)
          Authenticates a user, using just a username and password.
 SecurityServerClient getSecurityServerClient()
          Returns an instance of the SecurityServerClient, for when you need more API access than the authentication manager provides.
 void invalidate(java.lang.String token)
          Marks the presented token as invalid, meaning that the principal it represents is no longer authenticated.
 boolean isAuthenticated(java.lang.String token, ValidationFactor[] validationFactors)
          Checks that the token (as returned from authenticate() is still valid, given the validation factors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthenticationManagerImpl

public AuthenticationManagerImpl(SecurityServerClient securityServerClient)
Method Detail

authenticate

public java.lang.String authenticate(PrincipalAuthenticationContext authenticationContext)
                              throws java.rmi.RemoteException,
                                     InvalidAuthorizationTokenException,
                                     InvalidAuthenticationException,
                                     InactiveAccountException,
                                     ApplicationAccessDeniedException
Description copied from interface: AuthenticationManager
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.

Specified by:
authenticate in interface AuthenticationManager
Parameters:
authenticationContext - The details of the user that is to be authenticated.
Returns:
Returns an authorization token if successful.
Throws:
java.rmi.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.
ApplicationAccessDeniedException

authenticate

public java.lang.String authenticate(java.lang.String username,
                                     java.lang.String password)
                              throws java.rmi.RemoteException,
                                     InvalidAuthorizationTokenException,
                                     InvalidAuthenticationException,
                                     InactiveAccountException,
                                     ApplicationAccessDeniedException
Description copied from interface: AuthenticationManager
Authenticates a user, using just a username and password.

Specified by:
authenticate in interface AuthenticationManager
Returns:
Returns an authorization token if successful.
Throws:
java.rmi.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.
ApplicationAccessDeniedException

isAuthenticated

public boolean isAuthenticated(java.lang.String token,
                               ValidationFactor[] validationFactors)
                        throws java.rmi.RemoteException,
                               InvalidAuthorizationTokenException,
                               ApplicationAccessDeniedException
Description copied from interface: AuthenticationManager
Checks that the token (as returned from authenticate() is still valid, given the validation factors.

Specified by:
isAuthenticated in interface AuthenticationManager
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:
java.rmi.RemoteException - A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.
ApplicationAccessDeniedException

invalidate

public void invalidate(java.lang.String token)
                throws java.rmi.RemoteException,
                       InvalidAuthorizationTokenException
Description copied from interface: AuthenticationManager
Marks the presented token as invalid, meaning that the principal it represents is no longer authenticated. Usually used to make the user logged-off.

Specified by:
invalidate in interface AuthenticationManager
Parameters:
token - The token presented by the user, as returned from authenticate()
Throws:
java.rmi.RemoteException - A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.

getSecurityServerClient

public SecurityServerClient getSecurityServerClient()
Description copied from interface: AuthenticationManager
Returns an instance of the SecurityServerClient, for when you need more API access than the authentication manager provides.

Specified by:
getSecurityServerClient in interface AuthenticationManager
Returns:


Copyright © 2008 Atlassian Pty Ltd. All Rights Reserved.