芝麻web文件管理V1.00
编辑当前文件:/home/pulsehostuk9/www/portal.pulsehost.co.uk/vendor/league/oauth2-google/src/Provider/Google.php
hostedDomain) { $options['hd'] = $this->hostedDomain; } if (empty($options['access_type']) && $this->accessType) { $options['access_type'] = $this->accessType; } if (empty($options['prompt']) && $this->prompt) { $options['prompt'] = $this->prompt; } // Default scopes MUST be included for OpenID Connect. // Additional scopes MAY be added by constructor or option. $scopes = array_merge($this->getDefaultScopes(), $this->scopes); if (!empty($options['scope'])) { $scopes = array_merge($scopes, $options['scope']); } $options['scope'] = array_unique($scopes); $options = parent::getAuthorizationParameters($options); // The "approval_prompt" MUST be removed as it is not supported by Google, use "prompt" instead: // https://developers.google.com/identity/protocols/oauth2/openid-connect#prompt unset($options['approval_prompt']); return $options; } protected function getDefaultScopes() { // "openid" MUST be the first scope in the list. return [ 'openid', 'email', 'profile', ]; } protected function getScopeSeparator() { return ' '; } protected function checkResponse(ResponseInterface $response, $data) { // @codeCoverageIgnoreStart if (empty($data['error'])) { return; } // @codeCoverageIgnoreEnd $code = 0; $error = $data['error']; if (is_array($error)) { $code = $error['code']; $error = $error['message']; } throw new IdentityProviderException($error, $code, $data); } protected function createResourceOwner(array $response, AccessToken $token) { $user = new GoogleUser($response); $this->assertMatchingDomain($user->getHostedDomain()); return $user; } /** * @throws HostedDomainException If the domain does not match the configured domain. */ protected function assertMatchingDomain($hostedDomain) { if ($this->hostedDomain === null) { // No hosted domain configured. return; } if ($this->hostedDomain === '*' && $hostedDomain) { // Any hosted domain is allowed. return; } if ($this->hostedDomain === $hostedDomain) { // Hosted domain is correct. return; } throw HostedDomainException::notMatchingDomain($this->hostedDomain); } }