We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
`@Bean public OAuth2UserService<OAuth2UserRequest, OAuth2User> oauth2UserService(WebClient rest) { DefaultOAuth2UserService delegate = new DefaultOAuth2UserService(); return request -> { OAuth2User user = delegate.loadUser(request); if (!"github".equals(request.getClientRegistration().getRegistrationId())) { return user; }
OAuth2AuthorizedClient client = new OAuth2AuthorizedClient (request.getClientRegistration(), user.getName(), request.getAccessToken()); String url = user.getAttribute("organizations_url"); List<Map<String, Object>> orgs = rest .get().uri(url)
.retrieve() .bodyToMono(List.class) .block(); if (orgs.stream().anyMatch(org -> "spring-projects".equals(org.get("login")))) { return user; } throw new OAuth2AuthenticationException(new OAuth2Error("invalid_token", "Not in Spring Team", "")); }; }`
After following the documentation, I keep getting error from the bolded line which is preventing the code from compiling/running.
I clone the repo and build but the same bolded section is throwing up a warning.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
`@Bean
public OAuth2UserService<OAuth2UserRequest, OAuth2User> oauth2UserService(WebClient rest) {
DefaultOAuth2UserService delegate = new DefaultOAuth2UserService();
return request -> {
OAuth2User user = delegate.loadUser(request);
if (!"github".equals(request.getClientRegistration().getRegistrationId())) {
return user;
}
.attributes(oauth2AuthorizedClient(client))
After following the documentation, I keep getting error from the bolded line which is preventing the code from compiling/running.
I clone the repo and build but the same bolded section is throwing up a warning.
The text was updated successfully, but these errors were encountered: