public function GoogleAuthController::redirectToGoogle in Social Auth Google 8
Redirect to Google Services Authentication page.
Return value
\Zend\Diactoros\Response\RedirectResponse Redirection to Google Accounts.
1 string reference to 'GoogleAuthController::redirectToGoogle'
File
- src/
Controller/ GoogleAuthController.php, line 87
Class
- GoogleAuthController
- Manages requests to Google API.
Namespace
Drupal\social_auth_google\ControllerCode
public function redirectToGoogle() {
/* @var \Google_Client $client */
$client = $this->networkManager
->createInstance('social_auth_google')
->getSdk();
$client
->setScopes([
'email',
'profile',
]);
return new RedirectResponse($client
->createAuthUrl());
}