ashwinks / PHP-LinkedIn-SDK

A PHP wrapper for the LinkedIn API
94 stars 75 forks source link

Why does getAccessCode check for an existing access code when an authorization code is specified? #38

Open atomjack opened 6 years ago

atomjack commented 6 years ago

I'm confused as to why the getAccessCode($authorization_code) method always has to return a previously existing access code if one exists. It seems to me that if you specify an authorization code, it should request a new access token using that code regardless of whether or not the API has had an access token set.

I'm saving my access token, but of course I will have to request a new one periodically before it expires. I'd like to be able to do this without having to worry about whether or not I can set the access token beforehand (I have another custom class that is using the LI API and it tells the api to use the access token it has saved as soon as it instantiates).