Package org.forgerock.tokenhandler
Interface TokenHandler
- 
- All Known Implementing Classes:
- JwtTokenHandler,- SecretsJwtTokenHandler
 
 public interface TokenHandlerResponsible for the validation, generation and parsing of tokens used for keying a JsonValue representative of some state. Implementers must catch implementation-specific exceptions and re-throw asTokenHandlerException.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description Stringgenerate(JsonValue state)Generates a new token using the state.voidvalidate(String token)Validates the passed token.JsonValuevalidateAndExtractState(String token)Validates and parses the token, extracting any encapsulated state.
 
- 
- 
- 
Method Detail- 
generateString generate(JsonValue state) throws TokenHandlerException Generates a new token using the state.- Parameters:
- state- the state
- Returns:
- token
- Throws:
- TokenHandlerException- on failure to generate token
 
 - 
validatevoid validate(String token) throws TokenHandlerException Validates the passed token.- Parameters:
- token- the token to be validated
- Throws:
- InvalidTokenException- on invalid token
- ExpiredTokenException- on expired token
- TokenHandlerException- on other failure to validate token
 
 - 
validateAndExtractStateJsonValue validateAndExtractState(String token) throws TokenHandlerException Validates and parses the token, extracting any encapsulated state.- Parameters:
- token- the token to be validated and parsed
- Returns:
- the state
- Throws:
- InvalidTokenException- on invalid token
- ExpiredTokenException- on expired token
- TokenHandlerException- on other failure to validate or extract token
 
 
- 
 
-