zorn-v / nextcloud-social-login

GNU Affero General Public License v3.0
198 stars 137 forks source link

Provider returned no access_token #429

Open oujonny opened 9 months ago

oujonny commented 9 months ago

Hi I try to use this oauth client with laravel passport (as custom oauth2). If I test the provider with postman everything works perfectly. I can login, grant permissions and then get access tokens which can be used to get user info from the api.

But in the nextcloud it does not work. I see in the networking tab in the browser that I get 401 after the provider redirects back to nextcloud (http://localhost:8080/apps/sociallogin/custom_oauth2/seki?code=&state=). In the UI i see the error:

Provider returned no access_token: <!DOCTYPE html> <html class="ng-csp" data-placeholder-focus="false" lang="en" data-locale="en" > <head data-requesttoken=".......

I think it just returns the nextcloud login html.

I checked the state and that should be fine, as the state is the same as in the orignal request from the flow. Any idea why this is happening and where I could check for errors?

thanks & cheers

oujonny commented 9 months ago

Mist be a bug related to localhost. I have the nextcloud running on port 8080 and the laravel passport provider runs on port 80.

After i used ngork to serve laravel passport globally and used it public reachable endpoint everything worked. So i think the plugin messes around with different ports on the same node.