1 | <?php |
||
11 | class Google extends AbstractProvider |
||
12 | { |
||
13 | use BearerAuthorizationTrait; |
||
14 | |||
15 | const ACCESS_TOKEN_RESOURCE_OWNER_ID = 'id'; |
||
16 | |||
17 | /** |
||
18 | * @var string If set, this will be sent to google as the "access_type" parameter. |
||
19 | * @link https://developers.google.com/accounts/docs/OAuth2WebServer#offline |
||
20 | */ |
||
21 | protected $accessType; |
||
22 | |||
23 | /** |
||
24 | * @var string If set, this will be sent to google as the "hd" parameter. |
||
25 | * @link https://developers.google.com/accounts/docs/OAuth2Login#hd-param |
||
26 | */ |
||
27 | protected $hostedDomain; |
||
28 | |||
29 | /** |
||
30 | * @var array Default fields to be requested from the user profile. |
||
31 | * @link https://developers.google.com/+/web/api/rest/latest/people |
||
32 | */ |
||
33 | protected $defaultUserFields = [ |
||
34 | 'id', |
||
35 | 'name(familyName,givenName)', |
||
36 | 'displayName', |
||
37 | 'emails/value', |
||
38 | 'image/url', |
||
39 | ]; |
||
40 | /** |
||
41 | * @var array Additional fields to be requested from the user profile. |
||
42 | * If set, these values will be included with the defaults. |
||
43 | */ |
||
44 | protected $userFields = []; |
||
45 | |||
46 | /** |
||
47 | * Use OpenID Connect endpoints for getting the user info/resource owner |
||
48 | * @var bool |
||
49 | */ |
||
50 | protected $useOidcMode = false; |
||
51 | |||
52 | public function getBaseAuthorizationUrl() |
||
56 | |||
57 | public function getBaseAccessTokenUrl(array $params) |
||
61 | |||
62 | public function getResourceOwnerDetailsUrl(AccessToken $token) |
||
79 | |||
80 | protected function getAuthorizationParameters(array $options) |
||
94 | |||
95 | protected function getDefaultScopes() |
||
103 | |||
104 | protected function getScopeSeparator() |
||
108 | |||
109 | protected function checkResponse(ResponseInterface $response, $data) |
||
123 | |||
124 | protected function createResourceOwner(array $response, AccessToken $token) |
||
138 | } |
||
139 |