artdarek / oauth-4-laravel

OAuth Service Provider for Laravel 4
684 stars 217 forks source link

LinkedIn InvalidAuthorizationStateException #97

Open cmbirk opened 9 years ago

cmbirk commented 9 years ago

I'm running into this exception when trying to log in with LinkedIn. The odd issue here is it works locally, but not in my cloud development environment. I have made sure to include the correct urls in the developer panel. I've noticed that LinkedIn has some glaring issues with its OAuth system:

https://developer.linkedin.com/forum/unable-verify-access-token#comment-35438

and older:

https://developer.linkedin.com/forum/unauthorized-invalid-or-expired-token-immediately-after-receiving-oauth2-token?page=2

and I'm wondering if this could be the issue.

cmbirk commented 9 years ago

After looking a little deeper, the AbstractService call on line 255 makes this comparison:

$this->validateAuthorizationState() !== $state

On my local environment ( mac ), the left side resolves to a string, but on my cloud development server it resolves to an object:

Artdarek\OAuth\TokenStorage

Could this be an issue with session storage?

cmbirk commented 9 years ago

Running into this issue again recently. Still not sure what's happening.