Fix bug in oauth2Login sample
This commit is contained in:
parent
da0a7afa38
commit
bd4d814e4b
|
@ -36,8 +36,6 @@ import java.util.Map;
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
public class MainController {
|
public class MainController {
|
||||||
private WebClient webClient = WebClient.create();
|
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping("/")
|
@RequestMapping("/")
|
||||||
public String index(Model model, @AuthenticationPrincipal OAuth2User user, OAuth2UserAuthenticationToken authentication) {
|
public String index(Model model, @AuthenticationPrincipal OAuth2User user, OAuth2UserAuthenticationToken authentication) {
|
||||||
|
@ -52,8 +50,7 @@ public class MainController {
|
||||||
String userInfoEndpointUri = authentication.getClientAuthentication().getClientRegistration()
|
String userInfoEndpointUri = authentication.getClientAuthentication().getClientRegistration()
|
||||||
.getProviderDetails().getUserInfoEndpoint().getUri();
|
.getProviderDetails().getUserInfoEndpoint().getUri();
|
||||||
if (!StringUtils.isEmpty(userInfoEndpointUri)) { // userInfoEndpointUri is optional for OIDC Clients
|
if (!StringUtils.isEmpty(userInfoEndpointUri)) { // userInfoEndpointUri is optional for OIDC Clients
|
||||||
userAttributes = this.webClient
|
userAttributes = WebClient.builder()
|
||||||
.mutate()
|
|
||||||
.filter(oauth2Credentials(authentication))
|
.filter(oauth2Credentials(authentication))
|
||||||
.build()
|
.build()
|
||||||
.get()
|
.get()
|
||||||
|
|
Loading…
Reference in New Issue