1
0
mirror of synced 2026-08-05 01:36:56 +00:00

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:
Antonin Arquey
2020-04-09 11:12:53 +02:00
committed by Joe Grandja
parent 2cccf223df
commit 5cd1ec7bb3
6 changed files with 136 additions and 8 deletions
@@ -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();
}
----