Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,14 @@ private JwtDecoder getJwtDecoder(ClientRegistration clientRegistration) {
);
throw new OAuth2AuthenticationException(oauth2Error, oauth2Error.toString());
}
JwtDecoder jwtDecoder = this.jwtDecoders.get(jwkSetUri);
if (jwtDecoder == null) {
// TODO This should look at the Cache-Control header so to expire old jwtDecoders.
// Canvas looks to rotate it's keys monthly.
NimbusJwtDecoder.JwkSetUriJwtDecoderBuilder decoderBuilder = NimbusJwtDecoder.withJwkSetUri(jwkSetUri).jwsAlgorithm(SignatureAlgorithm.from(JwsAlgorithms.RS256));
// TODO This should look at the Cache-Control header so to expire old jwtDecoders.
// Canvas looks to rotate its keys monthly.
return this.jwtDecoders.computeIfAbsent(jwkSetUri, uri -> {
NimbusJwtDecoder.JwkSetUriJwtDecoderBuilder decoderBuilder = NimbusJwtDecoder.withJwkSetUri(uri).jwsAlgorithm(SignatureAlgorithm.from(JwsAlgorithms.RS256));
if (restOperations != null) {
decoderBuilder.restOperations(restOperations);
}
jwtDecoder = decoderBuilder.build();
this.jwtDecoders.put(jwkSetUri, jwtDecoder);
}
return jwtDecoder;
return decoderBuilder.build();
});
}
}