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
Rename bearerTokenConverter (and setter) to more generic name, eg. serverAuthenticationConverter
Rename BearerTokenServerWebExchangeMatcher to more generic name eg. AuthenticationServerWebExchangeMatcher and make it public.
Then, AuthenticationServerWebExchangeMatcher can be used as a securityMatcher when configuring SecurityFilterChain and also as matcher for authentication entry point, access denied handler and CSRF protection in OAuth2ResourceServerSpec.
Current Behavior
BearerTokenServerWebExchangeMatcher is private class in OAuth2ResourceServerSpec and is used as a matcher only for authentication entry point, access denied handler and CSRF protection.
It's necessary to create custom ServerWebExchangeMatcher which is almost identical with BearerTokenServerWebExchangeMatcher.
Context
We have defined multiple SecurityFilterChains, each has security matcher based on currently used authentication method.
I think something like this could be useful, though I'd recommend AuthenticationServerWebExchangeMatcher take the ServerAuthenticationConverter in its constructor, matching your code sample. I'd also recommend it be called AuthenticationConverterServerWebExchangeMatcher.
Are you able to submit a PR that introduces that class as well as refactors the resource server DSL to use it?
AuthenticationConverterServerWebExchangeMatcher is ServerWebExchangeMatcher implementation based on AuthenticationConverter which matches if ServerWebExchange can be converted to Authentication.
It can be used as a matcher where SecurityFilterChain should be matched based on used authentication method.
BearerTokenServerWebExchangeMatcher was replaced by this matcher.
Closesgh-8824
Expected Behavior
Rename bearerTokenConverter (and setter) to more generic name, eg. serverAuthenticationConverter
Rename BearerTokenServerWebExchangeMatcher to more generic name eg. AuthenticationServerWebExchangeMatcher and make it public.
Then, AuthenticationServerWebExchangeMatcher can be used as a securityMatcher when configuring SecurityFilterChain and also as matcher for authentication entry point, access denied handler and CSRF protection in OAuth2ResourceServerSpec.
Current Behavior
BearerTokenServerWebExchangeMatcher is private class in OAuth2ResourceServerSpec and is used as a matcher only for authentication entry point, access denied handler and CSRF protection.
It's necessary to create custom ServerWebExchangeMatcher which is almost identical with BearerTokenServerWebExchangeMatcher.
Context
We have defined multiple SecurityFilterChains, each has security matcher based on currently used authentication method.
The text was updated successfully, but these errors were encountered: