Skip to content

Commit

Permalink
KEYCLOAK-16543 fix compilation failure on keycloak-services
Browse files Browse the repository at this point in the history
  • Loading branch information
vramik authored and hmlnarik committed Dec 4, 2020
1 parent ea67033 commit bcfe985
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -634,15 +634,13 @@ public AccessToken transformAccessToken(KeycloakSession session, AccessToken tok
public AccessTokenResponse transformAccessTokenResponse(KeycloakSession session, AccessTokenResponse accessTokenResponse,
UserSessionModel userSession, ClientSessionContext clientSessionCtx) {

for (Map.Entry<ProtocolMapperModel, ProtocolMapper> entry : ProtocolMapperUtils.getSortedProtocolMappers(session, clientSessionCtx)) {
ProtocolMapperModel mapping = entry.getKey();
ProtocolMapper mapper = entry.getValue();
if (mapper instanceof OIDCAccessTokenResponseMapper) {
accessTokenResponse = ((OIDCAccessTokenResponseMapper) mapper).transformAccessTokenResponse(accessTokenResponse, mapping, session, userSession, clientSessionCtx);
}
}
AtomicReference<AccessTokenResponse> finalResponseToken = new AtomicReference<>(accessTokenResponse);
ProtocolMapperUtils.getSortedProtocolMappers(session, clientSessionCtx)
.filter(mapper -> mapper.getValue() instanceof OIDCAccessTokenResponseMapper)
.forEach(mapper -> finalResponseToken.set(((OIDCAccessTokenResponseMapper) mapper.getValue())
.transformAccessTokenResponse(finalResponseToken.get(), mapper.getKey(), session, userSession, clientSessionCtx)));

return accessTokenResponse;
return finalResponseToken.get();
}

public AccessToken transformUserInfoAccessToken(KeycloakSession session, AccessToken token,
Expand Down

0 comments on commit bcfe985

Please sign in to comment.