Support for separate backend request URLS for OAuth providers (like Keycloak) #2633
Replies: 1 comment 1 reply
-
Originally the question was the result of trying to run within Docker in combination with Keycloak. I finally figured out a reasonable method in case someone wanted to set up something similar as a workaround when developing with Docker and come across this thread:
The end result is the web browser on your desktop resolves all those hosts as Otherwise, if you are mainly interested in the server-side URL feature, I've created #2637 for it. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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.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: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: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.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
.Beta Was this translation helpful? Give feedback.
All reactions