Skip to content

Commit

Permalink
[OAuth2] Provider/Google - support identity.fields
Browse files Browse the repository at this point in the history
  • Loading branch information
ovr committed Jun 28, 2019
1 parent a573afe commit 4c12634
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/OAuth2/Provider/Google.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,24 @@ public function getIdentity(AccessTokenInterface $accessToken)
]
);

$fields = $this->getArrayOption('identity.fields', [
'id',
'email',
'verified_email',
'name',
'given_name',
'family_name',
'picture',
'locale',
//
'gender',
'hd',
'link',
]);
if ($fields) {
$parameters['fields'] = implode(',', $fields);
}

if (!$response->isSuccess()) {
throw new InvalidResponse(
'API response with error code',
Expand Down

0 comments on commit 4c12634

Please sign in to comment.