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 Details

    • create

      Token create(long directoryID, String name, TokenLifetime tokenLifetime, List<ValidationFactor> validationFactors) throws InvalidTokenException
      Generates a token key based on the supplied validationFactors.
      Parameters:
      directoryID - associated directory for the Token
      name - the name for the token, this may be the 'username' of an associated Principal or application name.
      tokenLifetime - Requested lifetime of the token
      validationFactors - 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 supplied validationFactors.
      Parameters:
      directoryID - associated directory for the Token
      name - the name for the token, this may be the 'username' of an associated Principal or application name.
      tokenLifetime - Requested lifetime of the token
      validationFactors - 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 Token
      name - 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