Keycloak OpenID http redirect_uri but redirected in https

Hello,

We are trying to configure an openID client with a http shemes redirect_uri but keycloak redirects us in https.

In client’s config :

The client’s request :
https://XXXXXX/auth/realms/XXXXX/protocol/openid-connect/auth?client_id=XXX&state=XXXX&response_type=code&redirect_uri=http://localhost

All seems working (no “invalid redirect uri” message) exept that keycloak redirects browser in https scheme on https://localhost

Is there a way to enable an http redirect_uri ?

Thank you :slight_smile:

Okay so after many hours spent on troubleshooting, i found it related to this parameter in nginx reverse proxy :
proxy_redirect http:// https://

That change the Location header scheme to https.

So you have wrong TLS offloading. Your nginx doesn’t forward correct headers or Keycloak is not configured properly for that.

https://www.keycloak.org/docs/latest/server_installation/#_setting-up-a-load-balancer-or-proxy