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 TypeMethodDescriptioncreate
(long directoryID, String name, TokenLifetime tokenLifetime, List<ValidationFactor> validationFactors) Generates a token key based on the suppliedvalidationFactors
.create
(long directoryID, String name, TokenLifetime tokenLifetime, List<ValidationFactor> validationFactors, long secretNumber) Generates a token key based on the suppliedvalidationFactors
.createValidationHash
(long directoryID, String name, List<ValidationFactor> validationFactors, long secretNumber) Generates random hash based on the supplied parameters.
-
Method Details
-
create
Token create(long directoryID, String name, TokenLifetime tokenLifetime, List<ValidationFactor> validationFactors) throws 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:
InvalidTokenException
- If there was an error generating the key, usually if there was an encoding exception.
-
create
Token create(long directoryID, String name, TokenLifetime tokenLifetime, List<ValidationFactor> validationFactors, long secretNumber) throws 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:
InvalidTokenException
- If there was an error generating the key, usually if there was an encoding exception.
-
createValidationHash
String createValidationHash(long directoryID, String name, List<ValidationFactor> validationFactors, long secretNumber) throws 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:
InvalidTokenException
-