-
Notifications
You must be signed in to change notification settings - Fork 108
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
use relative OIDCRedirectURI where applicable #3448
Conversation
OIDCProviderMetadataURL https://example-proxy.com/dex/.well-known/openid-configuration | ||
OIDCClientID example.com | ||
OIDCClientSecret 83bc78b7-6f5e-4010-9d80-22f328aa6550 | ||
OIDCRedirectURI https://example.com/oidc | ||
OIDCRedirectURI https://example-proxy.com/oidc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may have been a bug unrelated to relative or absolute URIs.
You see here that OIDCProviderMetadataURL
is the proxy_server
, but OIDCRedirectURI
was the servername
. I assume we'd want the OIDCRedirectURI
to be the proxy, not the origin server. could it be that nobody runs dex behind a proxy and so nobody has encountered this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I follow, why not use relative for proxy too? I think the address seen by IDP like Keycloak or Dex would be the address that a user was using to access the OnDemand instance and that is configured to redirect back to after authentication.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I follow, why not use relative for proxy too? I think the address seen by IDP like Keycloak or Dex would be the address that a user was using to access the OnDemand instance and that is configured to redirect back to after authentication.
I guess my thinking was that apache may not know or use the proxy name. It seems to me that apache would use HTTP_HOST
(the apache servername) not HTTP_FORWARDED_FOR
(the proxy servername) (or similar IDK if that's the real header name).
I'll re-read the documentation to see if it's smart enough to generate the proxy name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you're right - their oidc_get_current_url_host
helper function can toggle off of forwarded for headers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update the PR because it does catch this edge case for proxies, so I can simplify it.
Use relative OIDCRedirectURI where applicable to support multiple servernames.
Use relative
OIDCRedirectURI
where applicable, i.e., when not using a proxy server.This is for partial support for #3442 - at least the OIDC bit.