1 | <?php |
||
11 | class Google extends AbstractProvider |
||
12 | { |
||
13 | use BearerAuthorizationTrait; |
||
14 | |||
15 | /** |
||
16 | * @var string If set, this will be sent to google as the "access_type" parameter. |
||
17 | * @link https://developers.google.com/identity/protocols/OpenIDConnect#authenticationuriparameters |
||
18 | */ |
||
19 | protected $accessType; |
||
20 | |||
21 | /** |
||
22 | * @var string If set, this will be sent to google as the "hd" parameter. |
||
23 | * Extra-feature: Also accept a comma-separated list of domains or domain regular expressions. |
||
24 | * In that case, Google connection screen is not bound to a specific hosted domain |
||
25 | * because no "hd" parameter is sent to Google, but domain matching is still done by this library. |
||
26 | * @link https://developers.google.com/identity/protocols/OpenIDConnect#authenticationuriparameters |
||
27 | */ |
||
28 | protected $hostedDomain; |
||
29 | |||
30 | /** |
||
31 | * @var string If set, this will be sent to google as the "prompt" parameter. |
||
32 | * @link https://developers.google.com/identity/protocols/OpenIDConnect#authenticationuriparameters |
||
33 | */ |
||
34 | protected $prompt; |
||
35 | |||
36 | /** |
||
37 | * @var array List of scopes that will be used for authentication. |
||
38 | * @link https://developers.google.com/identity/protocols/googlescopes |
||
39 | */ |
||
40 | protected $scopes = []; |
||
41 | |||
42 | public function getBaseAuthorizationUrl() |
||
46 | |||
47 | public function getBaseAccessTokenUrl(array $params) |
||
51 | |||
52 | public function getResourceOwnerDetailsUrl(AccessToken $token) |
||
56 | |||
57 | protected function getAuthorizationParameters(array $options) |
||
88 | |||
89 | protected function getDefaultScopes() |
||
98 | |||
99 | protected function getScopeSeparator() |
||
103 | |||
104 | protected function checkResponse(ResponseInterface $response, $data) |
||
122 | |||
123 | protected function createResourceOwner(array $response, AccessToken $token) |
||
131 | |||
132 | protected function isDomainExpression($str) |
||
136 | |||
137 | protected function isHostedDomainMultiple() |
||
141 | |||
142 | /** |
||
143 | * @throws HostedDomainException If the domain does not match the configured domain. |
||
144 | */ |
||
145 | protected function assertMatchingDomains($hostedDomain) |
||
166 | |||
167 | /** |
||
168 | * @return bool Whether user-originating domain equals or matches $reference. |
||
169 | */ |
||
170 | protected function assertMatchingDomain($reference, $hostedDomain) |
||
187 | } |
||
188 |