Package org.keycloak.jose.jws
Class DefaultTokenManager
java.lang.Object
org.keycloak.jose.jws.DefaultTokenManager
- All Implemented Interfaces:
TokenManager
-
Field Summary
Fields inherited from interface org.keycloak.models.TokenManager
DEFAULT_VALIDATOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncekManagementAlgorithm(TokenCategory category) <T extends Token>
TDecodes and verifies the token, ornullif the token was invalid<T> TdecodeClientJWT(String jwt, ClientModel client, BiConsumer<JOSE, ClientModel> jwtValidator, Class<T> clazz, boolean allowNoneAlgorithm) Encodes the supplied tokenencodeAndEncrypt(Token token) encryptAlgorithm(TokenCategory category) initLogoutToken(ClientModel client, UserModel user, AuthenticatedClientSessionModel clientSession) signatureAlgorithm(TokenCategory category) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.models.TokenManager
decodeClientJWT
-
Constructor Details
-
DefaultTokenManager
-
-
Method Details
-
encode
Description copied from interface:TokenManagerEncodes the supplied token- Specified by:
encodein interfaceTokenManager- Parameters:
token- the token to encode- Returns:
- The encoded token
-
decode
Description copied from interface:TokenManagerDecodes and verifies the token, ornullif the token was invalid- Specified by:
decodein interfaceTokenManager- Parameters:
token- the token to decodeclazz- the token type to return- Returns:
- The decoded token, or
nullif the token was not valid
-
decodeClientJWT
public <T> T decodeClientJWT(String jwt, ClientModel client, BiConsumer<JOSE, ClientModel> jwtValidator, Class<T> clazz, boolean allowNoneAlgorithm) - Specified by:
decodeClientJWTin interfaceTokenManager- Parameters:
jwt- 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 toallowNoneAlgorithm- 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
-
signatureAlgorithm
- Specified by:
signatureAlgorithmin interfaceTokenManager
-
encodeAndEncrypt
- Specified by:
encodeAndEncryptin interfaceTokenManager
-
cekManagementAlgorithm
- Specified by:
cekManagementAlgorithmin interfaceTokenManager
-
encryptAlgorithm
- Specified by:
encryptAlgorithmin interfaceTokenManager
-
initLogoutToken
public LogoutToken initLogoutToken(ClientModel client, UserModel user, AuthenticatedClientSessionModel clientSession) - Specified by:
initLogoutTokenin interfaceTokenManager
-