thephpleague / oauth2-client

Easy integration with OAuth 2.0 service providers.
http://oauth2-client.thephpleague.com
MIT License
3.64k stars 751 forks source link

Auth fails in client due to empty oauth.state in redirectUri when using iframe #938

Open Ray4R opened 2 years ago

Ray4R commented 2 years ago

i'm using OAuth client with Nextclouds OAuth. Everything is working great. But when starting OAuth out of an iFrame ( i embed my site as nextloud externel site) no state is giving after grant access to my site. Authorization code is set but state is empty.

https://...myserver/nextcloudlogin?state=&code=6a8Vk6cSEIhVcXZEcKBjGLWj4sIbmMhn...

Any help would be appreciated

edsonhoraciojunior commented 2 years ago

Do your iframe load correctly? Some services will fail OAuth requests - when it was originated from within an iframe - for security reasons. The response headers/body should contain more info as to why they failed. I faced this when trying to use Google OAuth inside an iframe.