1 | <?php |
||
10 | class Google extends AbstractProvider |
||
11 | { |
||
12 | use BearerAuthorizationTrait; |
||
13 | |||
14 | const ACCESS_TOKEN_RESOURCE_OWNER_ID = 'id'; |
||
15 | |||
16 | /** |
||
17 | * @var string If set, this will be sent to google as the "access_type" parameter. |
||
18 | * @link https://developers.google.com/accounts/docs/OAuth2WebServer#offline |
||
19 | */ |
||
20 | protected $accessType; |
||
21 | |||
22 | /** |
||
23 | * @var string If set, this will be sent to google as the "hd" parameter. |
||
24 | * @link https://developers.google.com/accounts/docs/OAuth2Login#hd-param |
||
25 | */ |
||
26 | protected $hostedDomain; |
||
27 | |||
28 | /** |
||
29 | * @var array Default fields to be requested from the user profile. |
||
30 | * @link https://developers.google.com/+/web/api/rest/latest/people |
||
31 | */ |
||
32 | protected $defaultUserFields = [ |
||
33 | 'id', |
||
34 | 'name(familyName,givenName)', |
||
35 | 'displayName', |
||
36 | 'emails/value', |
||
37 | 'image/url', |
||
38 | ]; |
||
39 | /** |
||
40 | * @var array Additional fields to be requested from the user profile. |
||
41 | * If set, these values will be included with the defaults. |
||
42 | */ |
||
43 | protected $userFields = []; |
||
44 | |||
45 | public function setUserFields(array $fields) |
||
49 | |||
50 | public function getBaseAuthorizationUrl() |
||
54 | |||
55 | public function getBaseAccessTokenUrl(array $params) |
||
59 | |||
60 | public function getResourceOwnerDetailsUrl(AccessToken $token) |
||
68 | |||
69 | protected function getAuthorizationParameters(array $options) |
||
83 | |||
84 | protected function getDefaultScopes() |
||
92 | |||
93 | protected function getScopeSeparator() |
||
97 | |||
98 | protected function checkResponse(ResponseInterface $response, $data) |
||
112 | |||
113 | protected function createResourceOwner(array $response, AccessToken $token) |
||
117 | } |
||
118 |