Class TokenFactoryImpl
java.lang.Object
com.atlassian.crowd.manager.token.factory.TokenFactoryImpl
- All Implemented Interfaces:
TokenFactory
The
TokenGenerator is responsible for generating tokens when a successful authentication has occurred.-
Constructor Summary
ConstructorsConstructorDescriptionTokenFactoryImpl(TokenKeyGenerator tokenKeyGenerator) TokenFactoryImpl(TokenKeyGenerator tokenKeyGenerator, com.atlassian.security.random.SecureRandomService secureRandomService) -
Method Summary
Modifier and TypeMethodDescriptioncom.atlassian.crowd.model.token.Tokencreate(long directoryID, String name, com.atlassian.crowd.model.token.TokenLifetime tokenLifetime, List<com.atlassian.crowd.model.authentication.ValidationFactor> validationFactors) Generates a token key based on the suppliedvalidationFactors.com.atlassian.crowd.model.token.Tokencreate(long directoryID, String name, com.atlassian.crowd.model.token.TokenLifetime tokenLifetime, List<com.atlassian.crowd.model.authentication.ValidationFactor> validationFactors, long secretNumber) Generates a token key based on the suppliedvalidationFactors.protected longcreateValidationHash(long directoryID, String name, List<com.atlassian.crowd.model.authentication.ValidationFactor> validationFactors, long secretNumber) Generates random hash based on the supplied parameters.
-
Constructor Details
-
TokenFactoryImpl
public TokenFactoryImpl(TokenKeyGenerator tokenKeyGenerator, com.atlassian.security.random.SecureRandomService secureRandomService) -
TokenFactoryImpl
-
-
Method Details
-
create
public com.atlassian.crowd.model.token.Token create(long directoryID, String name, com.atlassian.crowd.model.token.TokenLifetime tokenLifetime, List<com.atlassian.crowd.model.authentication.ValidationFactor> validationFactors) throws com.atlassian.crowd.exception.InvalidTokenException Description copied from interface:TokenFactoryGenerates a token key based on the suppliedvalidationFactors.- Specified by:
createin interfaceTokenFactory- Parameters:
directoryID- associated directory for the Tokenname- the name for the token, this may be the 'username' of an associated Principal or application name.tokenLifetime- Requested lifetime of the tokenvalidationFactors- The validation factors that are used when generating a key.- Returns:
- The generated key.
- Throws:
com.atlassian.crowd.exception.InvalidTokenException- If there was an error generating the key, usually if there was an encoding exception.
-
create
public com.atlassian.crowd.model.token.Token create(long directoryID, String name, com.atlassian.crowd.model.token.TokenLifetime tokenLifetime, List<com.atlassian.crowd.model.authentication.ValidationFactor> validationFactors, long secretNumber) throws com.atlassian.crowd.exception.InvalidTokenException Description copied from interface:TokenFactoryGenerates a token key based on the suppliedvalidationFactors.- Specified by:
createin interfaceTokenFactory- Parameters:
directoryID- associated directory for the Tokenname- the name for the token, this may be the 'username' of an associated Principal or application name.tokenLifetime- Requested lifetime of the tokenvalidationFactors- The validation factors that are used when generating a key.secretNumber- The 'secret number' to add as a validation factor- Returns:
- The generated key.
- Throws:
com.atlassian.crowd.exception.InvalidTokenException- If there was an error generating the key, usually if there was an encoding exception.
-
createValidationHash
public String createValidationHash(long directoryID, String name, List<com.atlassian.crowd.model.authentication.ValidationFactor> validationFactors, long secretNumber) throws com.atlassian.crowd.exception.InvalidTokenException Description copied from interface:TokenFactoryGenerates random hash based on the supplied parameters.- Specified by:
createValidationHashin interfaceTokenFactory- Parameters:
directoryID- associated directory for the Tokenname- the name for the token, this may be the 'username' of an associated Principal or application name.validationFactors- The validation factors that are used when generating a key.secretNumber- The 'secret number' to add as a validation factor- Returns:
- Throws:
com.atlassian.crowd.exception.InvalidTokenException
-
createSecretValidationNumber
protected long createSecretValidationNumber()
-