public class TokenFactoryImpl extends Object implements TokenFactory
TokenGenerator
is responsible for generating tokens when a successful authentication has occurred.Constructor and Description |
---|
TokenFactoryImpl(TokenKeyGenerator tokenKeyGenerator) |
TokenFactoryImpl(TokenKeyGenerator tokenKeyGenerator,
com.atlassian.security.random.SecureRandomService secureRandomService) |
Modifier and Type | Method and Description |
---|---|
Token |
create(long directoryID,
String name,
TokenLifetime tokenLifetime,
List<ValidationFactor> validationFactors)
Generates a token key based on the supplied
validationFactors . |
Token |
create(long directoryID,
String name,
TokenLifetime tokenLifetime,
List<ValidationFactor> validationFactors,
long secretNumber)
Generates a token key based on the supplied
validationFactors . |
protected long |
createSecretValidationNumber() |
String |
createValidationHash(long directoryID,
String name,
List<ValidationFactor> validationFactors,
long secretNumber)
Generates random hash based on the supplied parameters.
|
public TokenFactoryImpl(TokenKeyGenerator tokenKeyGenerator, com.atlassian.security.random.SecureRandomService secureRandomService)
public TokenFactoryImpl(TokenKeyGenerator tokenKeyGenerator)
public Token create(long directoryID, String name, TokenLifetime tokenLifetime, List<ValidationFactor> validationFactors) throws InvalidTokenException
TokenFactory
validationFactors
.create
in interface TokenFactory
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.InvalidTokenException
- If there was an error generating the key, usually if there was an encoding exception.public Token create(long directoryID, String name, TokenLifetime tokenLifetime, List<ValidationFactor> validationFactors, long secretNumber) throws InvalidTokenException
TokenFactory
validationFactors
.create
in interface TokenFactory
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 factorInvalidTokenException
- If there was an error generating the key, usually if there was an encoding exception.public String createValidationHash(long directoryID, String name, List<ValidationFactor> validationFactors, long secretNumber) throws InvalidTokenException
TokenFactory
createValidationHash
in interface TokenFactory
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 factorInvalidTokenException
protected long createSecretValidationNumber()
Copyright © 2021 Atlassian. All rights reserved.