1
0
mirror of synced 2026-08-04 09:17:02 +00:00

Internalize Nimbus JwtDecoder Builder

Issue: gh-6010
This commit is contained in:
Josh Cummings
2019-03-04 22:22:49 -07:00
parent b93528138e
commit 9478abebd2
10 changed files with 334 additions and 430 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,7 +25,6 @@ import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.oauth2.jwt.JwtDecoder;
import org.springframework.security.oauth2.jwt.JwtProcessors;
import org.springframework.security.oauth2.jwt.NimbusJwtDecoder;
/**
@@ -50,7 +49,7 @@ public class OAuth2ResourceServerSecurityConfiguration extends WebSecurityConfig
@Bean
JwtDecoder jwtDecoder() throws Exception {
return new NimbusJwtDecoder(JwtProcessors.withPublicKey(key()).build());
return NimbusJwtDecoder.withPublicKey(key()).build();
}
private RSAPublicKey key() throws Exception {