Package org.keycloak.models
Interface TokenManager
-
- All Known Implementing Classes:
DefaultTokenManager
public interface TokenManager
-
-
Field Summary
Fields Modifier and Type Field Description static BiConsumer<JOSE,ClientModel>
DEFAULT_VALIDATOR
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description String
cekManagementAlgorithm(TokenCategory category)
<T extends Token>
Tdecode(String token, Class<T> clazz)
Decodes and verifies the token, ornull
if the token was invaliddefault <T> T
decodeClientJWT(String token, ClientModel client, Class<T> clazz)
<T> T
decodeClientJWT(String token, ClientModel client, BiConsumer<JOSE,ClientModel> jwtValidator, Class<T> clazz)
String
encode(Token token)
Encodes the supplied tokenString
encodeAndEncrypt(Token token)
String
encryptAlgorithm(TokenCategory category)
LogoutToken
initLogoutToken(ClientModel client, UserModel user, AuthenticatedClientSessionModel clientSessionModel)
String
signatureAlgorithm(TokenCategory category)
-
-
-
Field Detail
-
DEFAULT_VALIDATOR
static final BiConsumer<JOSE,ClientModel> DEFAULT_VALIDATOR
-
-
Method Detail
-
encode
String encode(Token token)
Encodes the supplied token- Parameters:
token
- the token to encode- Returns:
- The encoded token
-
decode
<T extends Token> T decode(String token, Class<T> clazz)
Decodes and verifies the token, ornull
if the token was invalid- Type Parameters:
T
-- Parameters:
token
- the token to decodeclazz
- the token type to return- Returns:
- The decoded token, or
null
if the token was not valid
-
signatureAlgorithm
String signatureAlgorithm(TokenCategory category)
-
decodeClientJWT
default <T> T decodeClientJWT(String token, ClientModel client, Class<T> clazz)
- Type Parameters:
T
-- Parameters:
token
-client
-clazz
-- Returns:
-
decodeClientJWT
<T> T decodeClientJWT(String token, ClientModel client, BiConsumer<JOSE,ClientModel> jwtValidator, Class<T> clazz)
-
cekManagementAlgorithm
String cekManagementAlgorithm(TokenCategory category)
-
encryptAlgorithm
String encryptAlgorithm(TokenCategory category)
-
initLogoutToken
LogoutToken initLogoutToken(ClientModel client, UserModel user, AuthenticatedClientSessionModel clientSessionModel)
-
-