Package org.keycloak.models
Interface TokenManager
- All Known Implementing Classes:
DefaultTokenManager
public interface TokenManager
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncekManagementAlgorithm(TokenCategory category) <T extends Token>
TDecodes and verifies the token, ornullif the token was invaliddefault <T> TdecodeClientJWT(String token, ClientModel client, Class<T> clazz) <T> TdecodeClientJWT(String token, ClientModel client, BiConsumer<JOSE, ClientModel> jwtValidator, Class<T> clazz, boolean allowAlgorithmNone) Encodes the supplied tokenencodeAndEncrypt(Token token) encryptAlgorithm(TokenCategory category) initLogoutToken(ClientModel client, UserModel user, AuthenticatedClientSessionModel clientSessionModel) signatureAlgorithm(TokenCategory category)
-
Field Details
-
DEFAULT_VALIDATOR
-
-
Method Details
-
encode
Encodes the supplied token- Parameters:
token- the token to encode- Returns:
- The encoded token
-
decode
Decodes and verifies the token, ornullif the token was invalid- Type Parameters:
T-- Parameters:
token- the token to decodeclazz- the token type to return- Returns:
- The decoded token, or
nullif the token was not valid
-
signatureAlgorithm
-
decodeClientJWT
- Parameters:
token- JWT token, which might be signed or encrypted by the keys of specified client. It cannot use "alg: none" in the headerclient- client, whose keys/secret might be used to decrypt the token or verify it's signaturesclazz- class, which the provided token would be cast to- Returns:
- decoded java object from the provided token. If it returns null, then signature validation failed or provided token was not valid
-
decodeClientJWT
<T> T decodeClientJWT(String token, ClientModel client, BiConsumer<JOSE, ClientModel> jwtValidator, Class<T> clazz, boolean allowAlgorithmNone) - Parameters:
token- JWT token, which might be signed or encrypted by the keys of specified client. It can use "alg: none" in the header just if parameter "allowAlgorithmNone" is trueclient- client, whose keys/secret might be used to decrypt the token or verify it's signaturesjwtValidator- Additional validatorclazz- class, which the provided token would be cast toallowAlgorithmNone- Whether the token using "alg: none" is allowed or not. If this parameter is false and "alg: none" is used, theIllegalArgumentExceptionwill be thrown- Returns:
- decoded java object from the provided token. If it returns null, then signature validation failed or provided token was not valid
-
encodeAndEncrypt
-
cekManagementAlgorithm
-
encryptAlgorithm
-
initLogoutToken
LogoutToken initLogoutToken(ClientModel client, UserModel user, AuthenticatedClientSessionModel clientSessionModel)
-