You are here

public function LinkedInLinkController::linkAccount in Open Social 8

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

Response for path 'social-api/link/linkedin'.

Redirects the user to LinkedIn for joining accounts.

1 string reference to 'LinkedInLinkController::linkAccount'
social_auth_linkedin.routing.yml in modules/custom/social_auth_linkedin/social_auth_linkedin.routing.yml
modules/custom/social_auth_linkedin/social_auth_linkedin.routing.yml

File

modules/custom/social_auth_linkedin/src/Controller/LinkedInLinkController.php, line 46

Class

LinkedInLinkController
Class LinkedInLinkController.

Namespace

Drupal\social_auth_linkedin\Controller

Code

public function linkAccount() {
  $sdk = $this
    ->getSdk();
  if ($sdk instanceof RedirectResponse) {
    return $sdk;
  }
  $this->authManager
    ->setSdk($sdk);
  $url = $this->authManager
    ->getAuthenticationUrl('link');
  return new TrustedRedirectResponse($url);
}