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