You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you want to integration test a resource server you need the OAuth2 client, but when you add that (even just in test scope) it changes the security configuration of a Spring Boot application by default - it is no longer a resource server, but instead it becomes an OAuth2 client (and installs an OAuth2 login filter instead of the resource server filter).
Also, it's kind of a pain to set up a RestClient with a bearer token for the test. You have to create an interceptor. With client credentials it looks like this:
Ideally we'd like a way to tell Spring Boot that to set that stuff up: 1) switch off the OAuth2SecurityFilterChainConfiguration (currently not visible and not an independent autoconfig, so you can't actually exclude it); 2) make it easier to create an HTTP client.
Sort of related to #43978 but this is for a webapp that is itself a resource server.
The text was updated successfully, but these errors were encountered:
If you want to integration test a resource server you need the OAuth2 client, but when you add that (even just in test scope) it changes the security configuration of a Spring Boot application by default - it is no longer a resource server, but instead it becomes an OAuth2 client (and installs an OAuth2 login filter instead of the resource server filter).
Also, it's kind of a pain to set up a
RestClient
with a bearer token for the test. You have to create an interceptor. With client credentials it looks like this:Ideally we'd like a way to tell Spring Boot that to set that stuff up: 1) switch off the
OAuth2SecurityFilterChainConfiguration
(currently not visible and not an independent autoconfig, so you can't actually exclude it); 2) make it easier to create an HTTP client.Sort of related to #43978 but this is for a webapp that is itself a resource server.
The text was updated successfully, but these errors were encountered: