thephpleague / oauth2-linkedin

LinkedIn Provider for the OAuth 2.0 Client
MIT License
83 stars 37 forks source link

Unable to retrieve access token #27

Closed picks44 closed 5 years ago

picks44 commented 5 years ago

Hi,

For some reason my code is not working anymore, the function $provider->getAccessToken() is now raising this error :

Unable to retrieve access token: appid/redirect uri/code verifier does not match authorization code. Or authorization code expired. Or external member binding exists

I've check my LinkedIn config and everything is fine. Everything was working fine until now, and we made zero changes... Any clue?

picks44 commented 5 years ago

I've tried to use v2 of the API using

$provider->withResourceOwnerVersion(2)->getAccessToken('authorization_code', [
            'code' => $code
        ]);

But I still get the same error

stevenmaguire commented 5 years ago

Package version 5.0.0 is now available with exclusive support for LinkedInAPI v2. I believe this will help to resolve the issues.

picks44 commented 5 years ago

Thanks @stevenmaguire, it's fine now!