You are here

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

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

Gets data about the user.

Return value

\League\OAuth2\Client\Provider\GenericResourceOwner|array|mixed User info returned by provider.

Overrides OAuth2ManagerInterface::getUserInfo

File

src/LinkedInAuthManager.php, line 54

Class

LinkedInAuthManager
Contains all the logic for LinkedIn OAuth2 authentication.

Namespace

Drupal\social_auth_linkedin

Code

public function getUserInfo() {
  if (!$this->user) {
    $this->user = $this->client
      ->getResourceOwner($this
      ->getAccessToken());
  }
  return $this->user;
}