We are currently setting up Keycloak as the new IDP. We have various environments with separate instances (dev, test, prod), but we also have our developers working on their local machines (local-dev).
The environments are working ok, but when we try to authenticate with the dev keycloak instance from our localhost (local-dev), we always get redirected to the dev-instance of the client rather than the localhost instance on the dev machine.
We have used other IDPs (e.g. Azure Active Directory) where this works ok, so we are wondering what we are doing wrong with keycloak or if it is supported at all?
Here is the setup and some examples:
- dev webserver (reverse proxy) instance:
- rewrites requests to /auth to the devidp.somedomain.com/auth using IIS rewrite
- X-Forwarded-For gets set
- ssl offloading
- dev Keycloak instance:
- Local dev machines, running angular client on:
- for now we are using implicit flow
- https://localhost:4200/* is set as valid redirect uri on dev keycloak
So the issuer url would look like:
- We navigate to
https://localhost:4200/someclientto our local instance of
- Angular redirects us to
- We log in
- Keycloak redirects to
Any idea how we could get the redirect to localhost to work with this setup?
We’d appreciate any hints