zorn-v / nextcloud-social-login

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

Gitlab return 'The redirect URI included is not valid.' #377

Closed SofianeLasri closed 1 year ago

SofianeLasri commented 1 year ago

Hello, I followed your tutorial to connect nextcloud with a gitlab account but, unfortunately, I didn't manage to make it works. I have this error when I click on the login button 'The redirect URI included is not valid.'. I have my own gitlab configured, here is my callback url: https://cloud.sl-projects.com/apps/sociallogin/custom_oidc/gitlab

If I put a slash at the end, it redirects me directly throught the login page. But I don't touch the url I get the error message. I didn't find help anywhere else, how can I fix that? :/

Thx in advance for help!

zorn-v commented 1 year ago

Check hint about callbackreply url https://github.com/zorn-v/nextcloud-social-login#about-callbackreply-url Did you try 'overwriteprotocol' => 'https' ?

SofianeLasri commented 1 year ago

Thx for your fast answer! Yes I already put that into the Nextcloud config file. It doesn't to change anything for me. :/

zorn-v commented 1 year ago

Then check url (in browser) on that page which say "The redirect URI included is not valid." There is query parameter with redirect url - compare it carefully with actual redirect url in you gitlab settings. Possibly NC wrong detect host - then use overwritehost. Or maybe it generate url with index.php in it - then just add another url to gitlab (or try to use htaccess.RewriteBase)

SofianeLasri commented 1 year ago

Thanks a lot for your help! The problem was that Nextcloud added 'index.php' after the hostname. So Gitlab didn't received the correct URL, even if the both redirect to the same page. I change the callback url by the one sended by Nextcloud and it worked. 👍