Fix bug in oauth2Login sample

This commit is contained in:
Joe Grandja 2017-10-10 14:40:11 -04:00
parent da0a7afa38
commit bd4d814e4b
1 changed files with 1 additions and 4 deletions

View File

@ -36,8 +36,6 @@ import java.util.Map;
*/
@Controller
public class MainController {
private WebClient webClient = WebClient.create();
@RequestMapping("/")
public String index(Model model, @AuthenticationPrincipal OAuth2User user, OAuth2UserAuthenticationToken authentication) {
@ -52,8 +50,7 @@ public class MainController {
String userInfoEndpointUri = authentication.getClientAuthentication().getClientRegistration()
.getProviderDetails().getUserInfoEndpoint().getUri();
if (!StringUtils.isEmpty(userInfoEndpointUri)) { // userInfoEndpointUri is optional for OIDC Clients
userAttributes = this.webClient
.mutate()
userAttributes = WebClient.builder()
.filter(oauth2Credentials(authentication))
.build()
.get()