Add AuthoritiesMapper setter for reactive OAuth2Login
Allow the configuration of a custom GrantedAuthorityMapper for reactive OAuth2Login - Add setter in OidcAuthorizationCodeReactiveAuthenticationManager and OAuth2LoginReactiveAuthenticationManager - Use an available GrantedAuthorityMapper bean to configure the default ReactiveAuthenticationManager Fixes gh-8324
This commit is contained in:
committed by
Joe Grandja
parent
2cccf223df
commit
5cd1ec7bb3
@@ -160,3 +160,21 @@ SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
|
||||
return http.build();
|
||||
}
|
||||
----
|
||||
|
||||
You may register a `GrantedAuthoritiesMapper` `@Bean` to have it automatically applied to the default configuration, as shown in the following example:
|
||||
|
||||
[source,java]
|
||||
----
|
||||
@Bean
|
||||
public GrantedAuthoritiesMapper userAuthoritiesMapper() {
|
||||
...
|
||||
}
|
||||
|
||||
@Bean
|
||||
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
|
||||
http
|
||||
// ...
|
||||
.oauth2Login(withDefaults());
|
||||
return http.build();
|
||||
}
|
||||
----
|
||||
|
||||
Reference in New Issue
Block a user