diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/oauth2/server/resource/OAuth2ResourceServerConfigurer.java b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/oauth2/server/resource/OAuth2ResourceServerConfigurer.java index 4f252d7912..d03662615e 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/web/configurers/oauth2/server/resource/OAuth2ResourceServerConfigurer.java +++ b/config/src/main/java/org/springframework/security/config/annotation/web/configurers/oauth2/server/resource/OAuth2ResourceServerConfigurer.java @@ -199,13 +199,17 @@ public final class OAuth2ResourceServerConfigurer decoder(JwtDecoder decoder) { + public JwtConfigurer decoder(JwtDecoder decoder) { this.decoder = decoder; - return OAuth2ResourceServerConfigurer.this; + return this; } - public OAuth2ResourceServerConfigurer jwkSetUri(String uri) { + public JwtConfigurer jwkSetUri(String uri) { this.decoder = new NimbusJwtDecoderJwkSupport(uri); + return this; + } + + public OAuth2ResourceServerConfigurer and() { return OAuth2ResourceServerConfigurer.this; }