Interface TokenFactory
- All Known Implementing Classes:
TokenFactoryImpl
public interface TokenFactory
Responsible for the creation of
Token's this should be the
only way you create a Token for Crowd-
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.createValidationHash(long directoryID, String name, List<com.atlassian.crowd.model.authentication.ValidationFactor> validationFactors, long secretNumber) Generates random hash based on the supplied parameters.
-
Method Details
-
create
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 Generates a token key based on the suppliedvalidationFactors.- 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
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 Generates a token key based on the suppliedvalidationFactors.- 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
String createValidationHash(long directoryID, String name, List<com.atlassian.crowd.model.authentication.ValidationFactor> validationFactors, long secretNumber) throws com.atlassian.crowd.exception.InvalidTokenException Generates random hash based on the supplied parameters.- 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
-