Class TokenKeyGeneratorImpl
java.lang.Object
com.atlassian.crowd.manager.token.factory.TokenKeyGeneratorImpl
- All Implemented Interfaces:
TokenKeyGenerator
-
Constructor Summary
ConstructorDescriptionTokenKeyGeneratorImpl
(TrustedProxyManager trustedProxyManager, String algorithm, Base64.Encoder encoder) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addValidationFactor
(StringBuilder message, List<ValidationFactor> validationFactors, String factorName) If it exists, adds the validation factor specified infactorName
to themessage
.generateIdentifierHash
(long directoryID, String name, List<ValidationFactor> validationFactors) Creates a String that will be used by aToken
as itsToken.identifierHash
.generateRandomHash
(long directoryID, String name, List<ValidationFactor> validationFactors) Creates a String that will be used by aToken
as itsToken.randomHash
.
-
Constructor Details
-
TokenKeyGeneratorImpl
public TokenKeyGeneratorImpl(TrustedProxyManager trustedProxyManager, String algorithm, Base64.Encoder encoder)
-
-
Method Details
-
generateRandomHash
public String generateRandomHash(long directoryID, String name, List<ValidationFactor> validationFactors) throws InvalidTokenException Description copied from interface:TokenKeyGenerator
Creates a String that will be used by aToken
as itsToken.randomHash
. This 'key' will be based on the passed in parameters.- Specified by:
generateRandomHash
in interfaceTokenKeyGenerator
- Returns:
- a base 64 encoded String representation of the passed in attributes
- Throws:
InvalidTokenException
-
generateIdentifierHash
public String generateIdentifierHash(long directoryID, String name, List<ValidationFactor> validationFactors) throws InvalidTokenException Description copied from interface:TokenKeyGenerator
Creates a String that will be used by aToken
as itsToken.identifierHash
. This 'key' will be based on the passed in parameters.- Specified by:
generateIdentifierHash
in interfaceTokenKeyGenerator
- Returns:
- a base 64 encoded String representation of the passed in attributes
- Throws:
InvalidTokenException
-
addValidationFactor
protected void addValidationFactor(StringBuilder message, List<ValidationFactor> validationFactors, String factorName) If it exists, adds the validation factor specified infactorName
to themessage
. Otherwise does nothing.- Parameters:
message
- message to buildvalidationFactors
- list of validation factorsfactorName
- name of validation factor to add
-