diff --git a/config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java b/config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java index fdf28d8f7d..83e363ad9c 100644 --- a/config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java +++ b/config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java @@ -2322,6 +2322,10 @@ public final class HttpSecurity extends * @Configuration * @EnableWebSecurity * public class OAuth2ClientSecurityConfig extends WebSecurityConfigurerAdapter { + * + * @Value("${spring.security.oauth2.resourceserver.jwt.key-value}") + * RSAPublicKey key; + * * @Override * protected void configure(HttpSecurity http) throws Exception { * http @@ -2333,14 +2337,14 @@ public final class HttpSecurity extends * oauth2ResourceServer * .jwt(jwt -> * jwt - * .jwtAuthenticationConverter(jwtDecoder()) + * .decoder(jwtDecoder()) * ) * ); * } * * @Bean * public JwtDecoder jwtDecoder() { - * return JwtDecoders.fromOidcIssuerLocation(issuerUri); + * return NimbusJwtDecoder.withPublicKey(this.key).build(); * } * } *