KEYCLOAK-5566 Google IdP doesn't reliably fetch user's full name (#4503)
This commit is contained in:
parent
684c8dd0ce
commit
da146f13c1
1 changed files with 6 additions and 0 deletions
|
@ -88,6 +88,12 @@ public class GoogleIdentityProvider extends OIDCIdentityProvider implements Soci
|
||||||
|
|
||||||
identity.getContextData().put(VALIDATED_ID_TOKEN, idToken);
|
identity.getContextData().put(VALIDATED_ID_TOKEN, idToken);
|
||||||
|
|
||||||
|
if (!getConfig().isDisableUserInfoService() && accessToken != null && name == null) {
|
||||||
|
JsonNode userInfo = SimpleHttp.doGet(getUserInfoUrl(), session)
|
||||||
|
.header("Authorization", "Bearer " + accessToken).asJson();
|
||||||
|
name = getJsonProperty(userInfo, "name");
|
||||||
|
}
|
||||||
|
|
||||||
identity.setId(id);
|
identity.setId(id);
|
||||||
identity.setName(name);
|
identity.setName(name);
|
||||||
identity.setEmail(email);
|
identity.setEmail(email);
|
||||||
|
|
Loading…
Reference in a new issue