com.atlassian.crowd.authentication
Class TokenFactoryImpl

java.lang.Object
  extended by com.atlassian.crowd.authentication.TokenFactoryImpl
All Implemented Interfaces:
TokenFactory

public class TokenFactoryImpl
extends java.lang.Object
implements TokenFactory

The TokenGenerator is responsible for generating tokens when a successful authentication has occured.


Constructor Summary
TokenFactoryImpl(TokenKeyGenerator tokenKeyGenerator, java.util.Random randomNumberGenerator)
           
 
Method Summary
 Token create(long directoryID, java.lang.String name, java.util.List<ValidationFactor> validationFactors)
          Generates a token key based on the supplied validationFactors.
 Token create(long directoryID, java.lang.String name, java.util.List<ValidationFactor> validationFactors, java.lang.String secretNumber)
          Generates a token key based on the supplied validationFactors.
protected  java.lang.String createSecretValidationNumber()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenFactoryImpl

public TokenFactoryImpl(TokenKeyGenerator tokenKeyGenerator,
                        java.util.Random randomNumberGenerator)
Method Detail

create

public Token create(long directoryID,
                    java.lang.String name,
                    java.util.List<ValidationFactor> validationFactors)
             throws InvalidTokenException
Description copied from interface: TokenFactory
Generates a token key based on the supplied validationFactors.

Specified by:
create in interface TokenFactory
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.
Returns:
The generated key.
Throws:
InvalidTokenException - If there was an error generating the key, usually if there was an encoding exception.

create

public Token create(long directoryID,
                    java.lang.String name,
                    java.util.List<ValidationFactor> validationFactors,
                    java.lang.String secretNumber)
             throws InvalidTokenException
Description copied from interface: TokenFactory
Generates a token key based on the supplied validationFactors.

Specified by:
create in interface TokenFactory
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:
The generated key.
Throws:
InvalidTokenException - If there was an error generating the key, usually if there was an encoding exception.

createSecretValidationNumber

protected java.lang.String createSecretValidationNumber()


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.