Invalid parameter: redirect_uri Authentication Origin: Application & API OSI layer 7 · Application Last updated 13 Oct 2026

Keycloak: We are sorry... Invalid parameter: redirect_uri

The redirect_uri in the login request isn’t in the Keycloak client’s Valid Redirect URIs.

Exact message you may see Invalid parameter: redirect_uriWe are sorry... Invalid parameter: redirect_uriInvalid redirect uri
Seen on: REST API

Meaning

Keycloak matches exactly or by wildcard. Ports, trailing slashes, http vs https behind proxies, and different hostnames (localhost vs 127.0.0.1) cause mismatches. Behind a proxy, Keycloak may also see the wrong scheme.

Common causes

  • URI not listed in Valid Redirect URIs
  • http vs https (proxy without forwarded headers)
  • Port/hostname/trailing slash differences
  • Using the wrong client

⚡ Quick fix

  1. Add the exact URI (or a careful wildcard) to Valid Redirect URIs
  2. Configure proxy headers (KC_PROXY_HEADERS=xforwarded)
  3. Use the same hostname consistently

Detailed fix by platform

Shell

  1. bash
    # Keycloak 24+ behind a reverse proxy
    KC_PROXY_HEADERS=xforwarded KC_HOSTNAME=https://auth.example.com /opt/keycloak/bin/kc.sh start

How to diagnose

  1. Request — redirect_uri parameter value
  2. Client — Valid Redirect URIs
  3. Proxy — Forwarded headers

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

401 — 401 Bearer error="invalid_token" (HTTP)401403 — 403 Bearer error="insufficient_scope" (HTTP)403Account is not fully set up — Keycloak: invalid_grant — Account is not fully set up (Authentication)Account is not fully …auth/account-exists-with-different-credential — Firebase Auth: account exists with a different credential (same email, other provider) (Google Cloud / Firebase)auth/account-exists-w…auth/popup-closed-by-user — Firebase Auth: auth/popup-closed-by-user / auth/popup-blocked / auth/cancelled-popup-request (Authentication)auth/popup-closed-by-…auth/unauthorized-domain — Firebase Auth: auth/unauthorized-domain — This domain is not authorized for OAuth operations for your Firebase project (Authentication)auth/unauthorized-dom…bad_verification_code — GitHub OAuth: {"error":"bad_verification_code","error_description":"The code passed is incorrect or expired."} (Authentication)bad_verification_codedeleted_client — Google OAuth: Error 401: deleted_client — The OAuth client was deleted (Authentication)deleted_clientInvalid p…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.