You are here

public function GoogleAuthManager::getAuthenticationUrl in Open Social 8.3

Same name and namespace in other branches
  1. 8.9 modules/custom/social_auth_google/src/GoogleAuthManager.php \Drupal\social_auth_google\GoogleAuthManager::getAuthenticationUrl()
  2. 8 modules/custom/social_auth_google/src/GoogleAuthManager.php \Drupal\social_auth_google\GoogleAuthManager::getAuthenticationUrl()
  3. 8.2 modules/custom/social_auth_google/src/GoogleAuthManager.php \Drupal\social_auth_google\GoogleAuthManager::getAuthenticationUrl()
  4. 8.4 modules/custom/social_auth_google/src/GoogleAuthManager.php \Drupal\social_auth_google\GoogleAuthManager::getAuthenticationUrl()
  5. 8.5 modules/custom/social_auth_google/src/GoogleAuthManager.php \Drupal\social_auth_google\GoogleAuthManager::getAuthenticationUrl()
  6. 8.6 modules/custom/social_auth_google/src/GoogleAuthManager.php \Drupal\social_auth_google\GoogleAuthManager::getAuthenticationUrl()
  7. 8.7 modules/custom/social_auth_google/src/GoogleAuthManager.php \Drupal\social_auth_google\GoogleAuthManager::getAuthenticationUrl()
  8. 8.8 modules/custom/social_auth_google/src/GoogleAuthManager.php \Drupal\social_auth_google\GoogleAuthManager::getAuthenticationUrl()

Returns the login URL where user will be redirected for authentication.

Parameters

string $type: Type of action. "login" or "register".

array $scope: List of permissions which should be asked during authentication.

Return value

string Absolute URL.

Overrides AuthManagerInterface::getAuthenticationUrl

File

modules/custom/social_auth_google/src/GoogleAuthManager.php, line 44

Class

GoogleAuthManager
Class GoogleAuthManager.

Namespace

Drupal\social_auth_google

Code

public function getAuthenticationUrl($type, array $scope = [
  'profile',
  'email',
]) {
  $redirect_url = $this
    ->getRedirectUrl($type);
  $this->sdk
    ->setRedirectUri($redirect_url);
  return $this->sdk
    ->createAuthUrl($scope);
}