com.atlassian.crowd.manager
Class GenericManager
java.lang.Object
com.atlassian.crowd.manager.GenericManager
- Direct Known Subclasses:
- ApplicationServiceGeneric
public abstract class GenericManager
- extends java.lang.Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected final org.apache.log4j.Logger logger
tokenDAO
protected TokenDAO tokenDAO
propertyManager
protected PropertyManager propertyManager
i18nHelper
protected I18nHelper i18nHelper
cacheManager
protected CacheManager cacheManager
tokenFactory
protected TokenFactory tokenFactory
directoryManager
protected DirectoryManager directoryManager
GenericManager
public GenericManager()
generateUserToken
protected Token generateUserToken(long directoryID,
AuthenticationContext authenticationContext)
throws InvalidTokenException
- This method will return a
Token based on the passed in parameters.
If a token already exists in the datastore, this token will be returned with an updated lastAccessed time.
If a token is not found based on the passed in parameters a new Token
will be generated an stored in the datastore.
- Parameters:
directoryID - the directoryID you wish to generate a Token forauthenticationContext - holder for the required attributes to authenticate against the Crowd server
- Returns:
- a
Token
- Throws:
InvalidTokenException - if there was an issue generating the key for a token.
generateApplicationToken
protected Token generateApplicationToken(ApplicationAuthenticationContext authenticationContext)
throws InvalidTokenException
- Throws:
InvalidTokenException
genericValidateToken
protected Token genericValidateToken(java.lang.String token,
ValidationFactor[] validationFactors)
throws InvalidTokenException
- Will validate a token key with the given
ValidationFactor's
against one (if it exists) in the datastore.
- Parameters:
token - the key of a TokenvalidationFactors - the ValidationFactor's that are being used for authentication
- Returns:
- the existing token if there is a match (with an updated lastAccessed time)
- Throws:
InvalidTokenException - thrown if the token keys are not equal, or the token has expired, or the token does not exist
isExpired
protected boolean isExpired(Token token)
isAllowedToAuthenticate
public boolean isAllowedToAuthenticate(java.lang.String username,
long directoryId,
Application application)
throws DirectoryAccessException
- Determines if a user is authorised to authenticate
with a given application.
For a a user to have access to an application:
- the Application must be active.
And either:
- the User is stored in a directory which
is associated to the Application and the "allow all
to authenticate" flag is true.
- the User is a member of a Group that
is allowed to authenticate with the Application and both
the User and Group are from the same
RemoteDirectory.
Note that this call is not cached and does not affect the
cache.
- Parameters:
application - application the user wants to authenticate with.username - the username of the user that wants to authenticate with the application.directoryId - the directoryId of the user that wants to authenticate with the application.
- Returns:
true iff the user is authorised to authenticate with the application.
- Throws:
DirectoryAccessException - if the directory implementation could not be loaded when performing a membership check.
isAllowedToAuthenticate
public boolean isAllowedToAuthenticate(Token token,
Application application,
boolean ignoreCache)
throws DirectoryAccessException
- Throws:
DirectoryAccessException
isAllowedToAuthenticate
public boolean isAllowedToAuthenticate(Token token,
Application application)
throws DirectoryAccessException
- Throws:
DirectoryAccessException
setI18nHelper
public void setI18nHelper(I18nHelper i18nHelper)
setTokenDAO
public void setTokenDAO(TokenDAO tokenDAO)
setPropertyManager
public void setPropertyManager(PropertyManager propertyManager)
setCacheManager
public void setCacheManager(CacheManager cacheManager)
setTokenFactory
public void setTokenFactory(TokenFactory tokenFactory)
setDirectoryManager
public void setDirectoryManager(DirectoryManager directoryManager)
Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.