Happyr / LinkedIn-API-client

A library to connect with LinkedIn API. Perfect if you are looking for an API client or SDK for LinkedIn
MIT License
198 stars 97 forks source link

how to get accessToken? #160

Open RomeoDavide91 opened 6 years ago

RomeoDavide91 commented 6 years ago
Q A
Bug? no
New Feature? no
Are you using composer? yes

I'm trying to get accessToken through queues.

There is no function that I am looking for.

The function should be:

$linkedIn = new Happyr\LinkedIn\LinkedIn($oauthToken, $oauthSecret); $accessToken = $linkedIn->getAccessToken($codeToken);

how do I receive the access token?

SuperToma commented 6 years ago

I find the way.

That's not explicit in the doc...

  1. Instanciate the library $this->linkedIn = new LinkedIn(self::LINKED_IN_API_KEY, self::LINKED_IN_CLIENT_SECRET);

  2. Generate the auto-connect link : echo '<a href="'.$this->linkedIn->getLoginUrl().'" >Click here</a>';

  3. You can get the token : $this->linkedIn->getAccessToken();