Polish JWT Signature Algorithm Discovery
- Moved support to JwtDecoders and ReactiveJwtDecoders since there is already the expectation that those classes make an outbound connection to complete configuration. Since there's no outbound connection when configuring a NimbusJwtDecoder or NimbusReactiveJwtDecoder, it would be more intrusive to change that. Closes gh-7160
This commit is contained in:
@@ -223,7 +223,6 @@ public class OAuth2ResourceServerConfigurerTests {
|
||||
public void getWhenUsingJwkSetUriThenAcceptsRequest() throws Exception {
|
||||
this.spring.register(WebServerConfig.class, JwkSetUriConfig.class, BasicController.class).autowire();
|
||||
mockWebServer(jwks("Default"));
|
||||
mockWebServer(jwks("Default"));
|
||||
String token = this.token("ValidNoScopes");
|
||||
// @formatter:off
|
||||
this.mvc.perform(get("/").with(bearerToken(token)))
|
||||
@@ -236,7 +235,6 @@ public class OAuth2ResourceServerConfigurerTests {
|
||||
public void getWhenUsingJwkSetUriInLambdaThenAcceptsRequest() throws Exception {
|
||||
this.spring.register(WebServerConfig.class, JwkSetUriInLambdaConfig.class, BasicController.class).autowire();
|
||||
mockWebServer(jwks("Default"));
|
||||
mockWebServer(jwks("Default"));
|
||||
String token = this.token("ValidNoScopes");
|
||||
// @formatter:off
|
||||
this.mvc.perform(get("/").with(bearerToken(token)))
|
||||
@@ -1203,6 +1201,7 @@ public class OAuth2ResourceServerConfigurerTests {
|
||||
// @formatter:on
|
||||
mockWebServer(String.format(metadata, issuerThree, issuerThree));
|
||||
mockWebServer(jwkSet);
|
||||
mockWebServer(jwkSet);
|
||||
// @formatter:off
|
||||
this.mvc.perform(get("/authenticated").with(bearerToken(jwtThree)))
|
||||
.andExpect(status().isUnauthorized())
|
||||
|
||||
@@ -148,7 +148,6 @@ public class OAuth2ResourceServerBeanDefinitionParserTests {
|
||||
public void getWhenUsingJwkSetUriThenAcceptsRequest() throws Exception {
|
||||
this.spring.configLocations(xml("WebServer"), xml("JwkSetUri")).autowire();
|
||||
mockWebServer(jwks("Default"));
|
||||
mockWebServer(jwks("Default"));
|
||||
String token = this.token("ValidNoScopes");
|
||||
// @formatter:off
|
||||
this.mvc.perform(get("/").header("Authorization", "Bearer " + token))
|
||||
|
||||
@@ -261,7 +261,6 @@ public class OAuth2ResourceServerSpecTests {
|
||||
this.spring.register(JwkSetUriConfig.class, RootController.class).autowire();
|
||||
MockWebServer mockWebServer = this.spring.getContext().getBean(MockWebServer.class);
|
||||
mockWebServer.enqueue(new MockResponse().setBody(this.jwkSet));
|
||||
mockWebServer.enqueue(new MockResponse().setBody(this.jwkSet));
|
||||
// @formatter:off
|
||||
this.client.get()
|
||||
.headers((headers) -> headers
|
||||
@@ -277,7 +276,6 @@ public class OAuth2ResourceServerSpecTests {
|
||||
this.spring.register(JwkSetUriInLambdaConfig.class, RootController.class).autowire();
|
||||
MockWebServer mockWebServer = this.spring.getContext().getBean(MockWebServer.class);
|
||||
mockWebServer.enqueue(new MockResponse().setBody(this.jwkSet));
|
||||
mockWebServer.enqueue(new MockResponse().setBody(this.jwkSet));
|
||||
// @formatter:off
|
||||
this.client.get()
|
||||
.headers((headers) -> headers
|
||||
|
||||
Reference in New Issue
Block a user