mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-10 15:32:05 -03:30
Fix NPE when client is not set in context during token encoding
This commit fixes an issue throwing an NPE when trying to encode a token without having a client set in the session context. In other places in this class (like getSignatureAlgorithm(String)) this is checked. But in the type(TokenCategory) it was forgotten to check.
This commit is contained in:
parent
05d0c34681
commit
b70342dda7
@ -244,7 +244,7 @@ public class DefaultTokenManager implements TokenManager {
|
||||
switch (category) {
|
||||
case ACCESS:
|
||||
ClientModel client = session.getContext().getClient();
|
||||
return OIDCAdvancedConfigWrapper.fromClientModel(client).isUseRfc9068AccessTokenHeaderType()
|
||||
return client != null && OIDCAdvancedConfigWrapper.fromClientModel(client).isUseRfc9068AccessTokenHeaderType()
|
||||
? TokenUtil.TOKEN_TYPE_JWT_ACCESS_TOKEN
|
||||
: "JWT";
|
||||
case LOGOUT:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user