zorn-v / nextcloud-social-login

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

Invalid redirect URI #402

Open GarrusVaka opened 1 year ago

GarrusVaka commented 1 year ago

For me the OAuth2 login does not work anymore because of Invalid redirect URI.

I noticed that the URI is now displayed in the address bar of the browser as follows:

https%3A%2F%2Fcloud.example.tld%2Findex.php%2Fapps%2Fsociallogin%2Fcustom_oauth2%2Fboard&

Previously it was transferred like this: https://cloud.example.tld/index.php/apps/sociallogin/custom_oauth2/board

goetzk commented 1 year ago

Hi @GarrusVaka , I've just encountered this myself.

In my case - using ERP Next - I managed to track it down to a quirk on the EPRNext oauth-client page

That page has separate places for urls to be entered - "Redirect URIs" and "Default Redirect URI".

If our redirect url (https://nextcloud.example.com/apps/sociallogin/custom_oauth2/erpnext) is only in "Default Redirect URI" I see a URL encoded address like you were reporting. If i ALSO add the redirect url to "Redirect URIs", things work correctly and the URL is passed through unencoded.

I don't know what your platform is but if you also have multiple entry locations you may need to add your redirect url in both of them as I did.

freaknils commented 11 months ago

Hi, I had the same issue. Changing from https://example.com/index.php/apps/sociallogin/custom_oidc/gitlab to https://example.com/apps/sociallogin/custom_oidc/gitlab in GitLab Application fixed it for me on Nextcloud 27.0.0.1.