Skip to content
Snippets Groups Projects
Commit b56a74dd authored by Daniel Gerhardt's avatar Daniel Gerhardt
Browse files

Reject GoogleOidcProfile with unverified email

parent 87678184
No related merge requests found
......@@ -56,6 +56,9 @@ public class OauthUserDetailsService implements AuthenticationUserDetailsService
User user;
if (token.getDetails() instanceof GoogleOidcProfile) {
final GoogleOidcProfile profile = (GoogleOidcProfile) token.getDetails();
if (!profile.getEmailVerified()) {
throw new IllegalArgumentException("Email is not verified.");
}
user = userService.loadUser(UserProfile.AuthProvider.GOOGLE, profile.getEmail(),
grantedAuthorities, true);
} else if (token.getDetails() instanceof TwitterProfile) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment