You are here

public function LinkedInAuthManager::getAuthorizationUrl in Social Auth LinkedIn 3.x

Same name and namespace in other branches
  1. 8.2 src/LinkedInAuthManager.php \Drupal\social_auth_linkedin\LinkedInAuthManager::getAuthorizationUrl()

Returns the authorization URL where user will be redirected.

Return value

string|mixed Absolute authorization URL.

Overrides OAuth2ManagerInterface::getAuthorizationUrl

File

src/LinkedInAuthManager.php, line 65

Class

LinkedInAuthManager
Contains all the logic for LinkedIn OAuth2 authentication.

Namespace

Drupal\social_auth_linkedin

Code

public function getAuthorizationUrl() {
  $scopes = [
    'r_liteprofile',
    'r_emailaddress',
  ];
  $extra_scopes = $this
    ->getScopes();
  if ($extra_scopes) {
    $scopes = array_merge($scopes, explode(',', $extra_scopes));
  }

  // Returns the URL where user will be redirected.
  return $this->client
    ->getAuthorizationUrl([
    'scope' => $scopes,
  ]);
}