nextcloud / nextcloud/user_oidc
Authentication to external OIDC server (Keycloak) does not work - error "Too many redirects"
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 181
- Forks
- 60
- Avg merge
- 7h 34m
- Merged PRs (30d)
- 26
Description
I've configured the plugin as per documentation (https://www.schiessle.org/articles/2020/07/26/nextcloud-and-openid-connect/), but with the difference that my OIDC server does not run on the NC VM, it's available via its own domain.
I've configured the correct authentication endpoint for my Keycloak server in the app : https://mykeycloak.de/realms/cloud/protocol/openid-connect/auth
... and of course the correct client id and secret.
Clicking on the "Login with Keycloak" button on the NC login page leads to an error message "Too many redirects".
Watching the network requests in the browser console, at no point the auth endpoint of my Keycloak server is addressed. All requests are done to "https://cloud.mydomain.de/apps/user_oidc/login/1", looking like this:
https://cloud.mydomain.de/apps/user_oidc/login/1?client_id=keycloak&response_type=code&scope=openid+email+profile&redirect_uri=https://cloud.mydomain.de/apps/user_oidc/code&claims={"id_token":{"email":null,"name":null,"quota":null},"userinfo":{"email":null,"name":null,"quota":null}}&state=6XD043WIXV4L979X8087KRG8IVIBBBNC&nonce=B8Z2U1EPG0XYLHFIYIBLAU1TU4XC9NED
Is this issue already known? Anyone got this working with Keycloak on an external domain not running on the NC server itself?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the login flow from the Nextcloud login page and inspect the repeated /apps/user_oidc/login/1 requests described in the issue. Compare the configured external Keycloak authentication endpoint with the observed redirects; done means the flow reaches that endpoint and no longer ends in a redirect loop.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- authentication
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100