-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OIDC: PKCE Incorrectly Uses Base Redirect URL for ArgoCD Hosted Under Custom Path #18045
Comments
So the expected redirect url should be |
Exactly, it schould be |
Thanks @ptr1120 , normally if you navigate through pages does that prefix |
Yes @Marvin9 it is preserved in my browser Url but |
Alright thanks. Then the only problem to solve is to discover the root URL in browser and then we can pass to the function mentioned in the issue. I will look into this once I get time. |
thanks @Marvin9 |
Just found this - and it is blocking a big release for us. We're moving from the bundled dex to our company IdP. When NOT using PKCE the redir is constructed correctly - E.g., Any chance a fix for this is in the works @Marvin9 ? |
To clarify - we were using Dex previously and we added the |
One more thing - the path is not taken into account when redirecting to
Seems to work. But very much looking fwd to a fix for this soon. |
Sorry for inactivity on this issue. The fix is pretty straightforward and I have tried once. But I wasn't able to properly test in my local environment as far as I remember (mostly due to the sub-path configuration). Happy to raise a PR if you would be able to verify its functioning. |
Could probably just use the settings from the argocd server params to construct the URL. Example: configs:
params:
server.rootpath: /argocd |
I will also add that the session expiration flow seems to not take into account PKCE when enabled. Tries to re-auth using /auth/callback without "code" flow. And the PKCE error page does not link back to /login using the base path. So lots to fix in this. We'll try to make a contribution. If we can. |
To recap all the issues here:
|
@Marvin9 your pr does not address when the token expires, the user is always sent to dex even if PKCE is set and configured. |
@ptr1120 Could you share your Valid post logout redirect URIs in Keycloak? Also, was any other PKCE related config in ArgoCD/Keycloak changed? |
closed by #20202 |
Checklist:
argocd version
.Describe the bug
I'm hosting ArgoCD at a custom base path (
mycompany.org/infra/argocd
) and using Keycloak as an external IdP. The configuration functions as expected until I enable PKCE (Proof Key for Code Exchange). Specifically, when enablePKCEAuthentication is set to true in theargocd-cm
config map, the ArgoCD frontend incorrectly useswindow.location.origin
as the redirect URL, as demonstrated in thegetPKCERedirectURI
function located in utils.ts.To Reproduce
Login via Keycloak
buttonExpected behavior
ArgoCD should respect one of the configured parameters (
server.rootpath
,server.basehref
, orurl
from theargocd-cm
orargocd-cmd-params-cm
config map) to determine the correct base URL for redirects.Version
The text was updated successfully, but these errors were encountered: