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

Polish #4904 Support GrantedAuthoritiesMapper @Bean for oauth2Login

This commit is contained in:
Joe Grandja
2018-01-22 22:21:15 -05:00
parent 444e2dade3
commit 84679a5d64
3 changed files with 97 additions and 93 deletions
+19
View File
@@ -6912,6 +6912,25 @@ public class OAuth2LoginSecurityConfig extends WebSecurityConfigurerAdapter {
}
----
Alternatively, you may register a `GrantedAuthoritiesMapper` `@Bean` to have it automatically applied to the configuration, as shown in the following example:
[source,java]
----
@EnableWebSecurity
public class OAuth2LoginSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.oauth2Login();
}
@Bean
public GrantedAuthoritiesMapper userAuthoritiesMapper() {
...
}
}
----
[[oauth2login-advanced-map-authorities-oauth2userservice]]
===== Delegation-based strategy with `OAuth2UserService`