-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Support backend URLs for oauth/Keycloak providers #2637
Comments
I originally asked this as a discussion q&a in #2633, but button to transfer/link back to a new issue didn't seem to work. |
Hi there! It looks like this issue hasn't had any activity for a while. It will be closed if no further activity occurs. If you think your issue is still relevant, feel free to comment on it to keep it open. (Read more at #912) Thanks! |
Still interested. Didn't get to potentially working on it myself since was still learning setting up a TS monorepo with NextJS projects. |
Hi there! It looks like this issue hasn't had any activity for a while. It will be closed if no further activity occurs. If you think your issue is still relevant, feel free to comment on it to keep it open. (Read more at #912) Thanks! |
Not stale. |
Finally got around to looking into this again. I'm now just configuring DNS request for the external hostname to resolve to Keycloak internal hostname -- easy to do with CoreDNS in Kubernetes in my use case. That seems like the more appropriate way to solve the problem. An alternative of course is a http client proxy, but that is covered in the other issue linked earlier. @balazsorban44, feel free to close if you don't think there is much other demand for this feature. |
Description 📓
I've had a goal to try running a Keycloak along with other services and a NextJS app locally before trying to run them out in a cloud. Keycloak and the NextJS server is behind a NGINX reverse proxy. I've had success with this in the past when I was using
@react-keycloak/ssr
on macOS, but besides trying outnext-auth
I'm also now trying to run everything within Docker as well.My issue is only partially fixed by using the
NEXTAUTH_URL_INTERNAL
parameter. Redirection to the login works, but when the callback happens the server side errors out:This is similar to #2509 except all API calls from the server, including the oauth provider routes, have to be mapped to a completely different name. I may be able to work around this by changing my configuration, but seems like it may be a standard use case to allow backends to use different API endpoints than frontend client user-agents as described in Keycloak's Server Installation guide. The discussion in #1261 and pull-request #2485 touched on things like
process.env.
vs.options.domain
.How to reproduce ☕️
I'm using v3.29.0 along with this
[...nextauth].tx
content since I haven't upgraded to the latest to get the Keycloak provider that looks like going to be released with v4:The
oidc_issuer
env is set to something likehttp://myapp.local:8082/auth/realms/myapp
since I'm publishing a http service on mDNS so I can test on macOS through its mDNSResolver and avoid modifying its hosts file. But those oAuth provider URLs seem to be not routable within the Docker bridge network.Contributing 🙌🏽
Yes, I am willing to help implement this feature in a PR
The text was updated successfully, but these errors were encountered: