File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
config/src/main/java/org/springframework/security/config/annotation/web/builders Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -2322,6 +2322,10 @@ public OAuth2ResourceServerConfigurer<HttpSecurity> oauth2ResourceServer() throw
2322
2322
* @Configuration
2323
2323
* @EnableWebSecurity
2324
2324
* public class OAuth2ClientSecurityConfig extends WebSecurityConfigurerAdapter {
2325
+ *
2326
+ * @Value("${spring.security.oauth2.resourceserver.jwt.key-value}")
2327
+ * RSAPublicKey key;
2328
+ *
2325
2329
* @Override
2326
2330
* protected void configure(HttpSecurity http) throws Exception {
2327
2331
* http
@@ -2333,14 +2337,14 @@ public OAuth2ResourceServerConfigurer<HttpSecurity> oauth2ResourceServer() throw
2333
2337
* oauth2ResourceServer
2334
2338
* .jwt(jwt ->
2335
2339
* jwt
2336
- * .jwtAuthenticationConverter (jwtDecoder())
2340
+ * .decoder (jwtDecoder())
2337
2341
* )
2338
2342
* );
2339
2343
* }
2340
2344
*
2341
2345
* @Bean
2342
2346
* public JwtDecoder jwtDecoder() {
2343
- * return JwtDecoders.fromOidcIssuerLocation(issuerUri );
2347
+ * return NimbusJwtDecoder.withPublicKey(this.key).build( );
2344
2348
* }
2345
2349
* }
2346
2350
* </pre>
You can’t perform that action at this time.
0 commit comments