Skip to content

Keycloak realm endpoint URLs

Enter your Keycloak server and realm to get every endpoint URL: issuer, discovery, authorization, token, UserInfo, JWKS, logout, introspection, SAML and the consoles.

Runs in your browser. Nothing you paste is sent to us.

Server

The public address, with /auth at the end if your server still uses that path. A made-up one is filled in.

For your app’s settings
OIDC_ISSUER=https://auth.example.com/realms/acme
OIDC_DISCOVERY_URL=https://auth.example.com/realms/acme/.well-known/openid-configuration
OIDC_JWKS_URL=https://auth.example.com/realms/acme/protocol/openid-connect/certs
Most libraries need only the issuer or the discovery URL and read the rest from it. The discovery document also lists what your server supports.

Endpoints

OpenID Connect
Issuer
https://auth.example.com/realms/acmethe iss claim of its tokens; opening it shows the realm’s public key
Discovery
https://auth.example.com/realms/acme/.well-known/openid-configuration
Authorization
https://auth.example.com/realms/acme/protocol/openid-connect/auth
Token
https://auth.example.com/realms/acme/protocol/openid-connect/token
UserInfo
https://auth.example.com/realms/acme/protocol/openid-connect/userinfo
JWKS (public keys)
https://auth.example.com/realms/acme/protocol/openid-connect/certs
Logout (end session)
https://auth.example.com/realms/acme/protocol/openid-connect/logout
Token introspection
https://auth.example.com/realms/acme/protocol/openid-connect/token/introspect
Token revocation
https://auth.example.com/realms/acme/protocol/openid-connect/revoke
Device authorization
https://auth.example.com/realms/acme/protocol/openid-connect/auth/device
Pushed authorization (PAR)
https://auth.example.com/realms/acme/protocol/openid-connect/ext/par/request
Backchannel authentication (CIBA)
https://auth.example.com/realms/acme/protocol/openid-connect/ext/ciba/auth
Dynamic client registration
https://auth.example.com/realms/acme/clients-registrations/openid-connect
SAML
SAML endpoint
https://auth.example.com/realms/acme/protocol/saml
IdP metadata
https://auth.example.com/realms/acme/protocol/saml/descriptor
Users
Account console
https://auth.example.com/realms/acme/account
Admin
Admin console
https://auth.example.com/admin/acme/console/master signs in to every realm at /admin/master/console/
Admin REST API
https://auth.example.com/admin/realms/acme

How to use it

  1. Enter the public server address, with /auth if your server still uses it.
  2. Enter the realm name.
  3. Copy the URLs your app or library asks for.

What to know

Every realm has its own set of endpoints under /realms/<realm>. Most OpenID Connect libraries need only the issuer or the discovery URL and read the rest from the discovery document.

The issuer is the base of the realm, and it must match the iss claim in tokens exactly. If it does not, check Keycloak’s hostname setting.

Since Keycloak 17 the default path has no /auth. Servers configured with http-relative-path=/auth keep it.

Every realm has its own set of URLs

In Keycloak, a realm is a separate space with its own users, clients, keys and settings. Each realm also has its own endpoints. The token endpoint of realm acme is not the token endpoint of realm master, and a token from one realm is never valid in another.

That is why the realm name appears in almost every URL an app uses. Getting it wrong, or mixing up the server address, is one of the most common reasons an integration fails on the first try.

This page explains how the URLs are built, which ones your app needs, and how to check them.

How Keycloak 26 builds realm URLs

Every realm URL starts with the server’s public address, followed by /realms/ and the realm name. The public address comes from the hostname option. Since Keycloak 17, the default path has no /auth prefix; servers configured with http-relative-path=/auth keep it.

The pattern
https://<host>[/<relative-path>]/realms/<realm>/<endpoint>

Use the realm name exactly as it appears in the admin console, with the same case. A small difference gives an error rather than a redirect.

The endpoints and what they are for

OpenID Connect

EndpointPath under /realms/<realm>Used for
Issuer(the realm URL itself)The iss claim of every token
Discovery/.well-known/openid-configurationLets libraries find everything else
Authorization/protocol/openid-connect/authSends the user to sign in
Token/protocol/openid-connect/tokenExchanges a code, refresh token or client credentials for tokens
UserInfo/protocol/openid-connect/userinfoReturns the signed-in user’s claims
JWKS/protocol/openid-connect/certsPublic keys to verify token signatures
Logout/protocol/openid-connect/logoutEnds the session (RP-initiated logout)
Introspection/protocol/openid-connect/token/introspectAsks whether a token is active
Revocation/protocol/openid-connect/revokeRevokes a refresh or access token

Less common OAuth flows

The device authorization endpoint (/protocol/openid-connect/auth/device) serves TVs and command-line tools. Pushed authorization requests use /protocol/openid-connect/ext/par/request. Client-initiated backchannel authentication (CIBA) uses /protocol/openid-connect/ext/ciba/auth. Dynamic client registration lives at /clients-registrations/openid-connect.

SAML

SAML clients use /protocol/saml for requests and responses. The realm’s identity provider metadata, with its signing certificate, is at /protocol/saml/descriptor.

Consoles and the admin API

Users manage their own profile, password and sessions in the account console at /realms/<realm>/account. Realm administrators sign in to /admin/<realm>/console/; server administrators use /admin/master/console/. The Admin REST API is under /admin/realms/<realm>, outside the /realms/ path.

What this tool does

Enter the server address and the realm name, and the tool lists every endpoint above as a full URL with a copy button. It also writes three lines you can paste into an app’s environment: the issuer, the discovery URL and the JWKS URL.

If your server still serves under /auth, include it in the address and every URL follows.

What it does not do

It builds URLs from the pattern; it does not call your server. It cannot tell whether the realm exists, whether a feature such as device flow or CIBA is enabled for your clients, or whether the proxy exposes a path. Open the discovery document to see what your server actually supports.

How to use it

  1. Enter the public address of your Keycloak, the one users see in their browser.
  2. Add /auth at the end only if your server is configured with that relative path.
  3. Enter the realm name exactly, with the same case.
  4. Copy the issuer or discovery URL into your app or library settings.
  5. Open the discovery URL in a browser to confirm the realm answers and the URLs match.

Which URL does your app need?

Most libraries need only one value. Give them the issuer or the discovery URL and they read the rest.

  • OpenID Connect libraries for web apps and SPAs usually ask for the issuer or "authority".
  • API gateways and resource servers that validate JWTs ask for the issuer and sometimes the JWKS URL.
  • Older or hand-written integrations ask for the authorization and token endpoints separately.
  • SAML service providers ask for the IdP metadata URL, or the file it returns.
Read the discovery document
curl -s https://auth.example.com/realms/acme/.well-known/openid-configuration | jq .

Testing the token endpoint

Once you have the URLs, a quick request shows whether the realm, the client and the network path all work. For a confidential client with a service account, the client credentials grant is the simplest test, because it needs no browser.

Client credentials request
curl -s -X POST https://auth.example.com/realms/acme/protocol/openid-connect/token \
  -d grant_type=client_credentials \
  -d client_id=billing-service \
  --data-urlencode "client_secret=$CLIENT_SECRET"

A JSON answer with an access_token means the endpoint, realm and client are right. An invalid_client error points at the client id or secret. A 404 or an HTML page usually means the URL or the proxy path is wrong. The client name and address above are samples.

One server, several realms

Many teams run several realms on one Keycloak: one per product, per customer or per environment. Each realm has its own issuer, keys and sessions, so the URLs differ only in the realm name.

That separation is useful, but it also means an app configured for one realm cannot accept tokens from another, even on the same host. If an API must accept users from two realms, it has to trust two issuers and read two JWKS URLs. Use the master realm only to manage the server, not for your own apps.

Where it helps

Connecting a new app

When a team adds sign-in to a service, the first question is which URLs to configure. The list gives them one source to copy from, built from the same address and realm.

Moving between environments

Staging and production often run the same realm name on different hosts. Generate both sets and keep them in each environment’s configuration, so nothing points at the wrong server after a deploy.

Upgrading from a version with /auth

Servers older than Keycloak 17 served everything under /auth. After an upgrade, apps still configured with /auth/realms/... get 404 errors. Either update every app, or keep http-relative-path=/auth until they are all moved.

Migrating realms to a new server

When realms move to a new host, every app’s issuer changes, and tokens issued by the old server stop being accepted. Plan the switch so users sign in again on the new server, and update issuer settings at the same time.

Common errors and fixes

Realm does not exist

The realm name in the URL does not match a realm on the server. Copy the exact name from the realm list in the admin console.

404 on /auth/realms/...

The server does not use the /auth prefix. Remove it from the URL, or configure http-relative-path=/auth if old clients cannot change yet.

Issuer mismatch

The app expects one issuer and the token carries another, often http instead of https, an internal host name or a different port. Fix the hostname option and proxy headers, then compare the issuer field of the discovery document with the app’s setting.

CORS errors on the token endpoint

Browser apps can only call the token and UserInfo endpoints from origins the client allows. Add the app’s origin to the client’s web origins, or use + to allow the origins of its redirect URIs.

Security notes

  • Discovery, JWKS and the issuer URL are public by design. They contain no secrets.
  • The admin console and Admin REST API do not need to be on the public address. Many teams serve them only on an internal or admin host.
  • Leave dynamic client registration closed to anonymous callers unless you rely on it; it is governed by client registration policies in the realm.
  • Never hard-code a JWKS key in an app. Read the JWKS URL, so key rotation does not break validation.

Best practices

  • Configure apps with the issuer or discovery URL rather than individual endpoints.
  • Keep the server address and realm name in configuration, never in code.
  • Use the same public address in every app, in identity provider settings and in documentation.
  • After a hostname or proxy change, open the discovery document from outside your network.
Questions

Frequently asked questions

What is the Keycloak token endpoint URL?

It is `https://<host>/realms/<realm>/protocol/openid-connect/token`. On servers configured with the old `/auth` path, add `/auth` before `/realms`.

Where is the OpenID configuration of a Keycloak realm?

At `https://<host>/realms/<realm>/.well-known/openid-configuration`. It lists every endpoint, supported grant types and signing algorithms for that realm.

What is the issuer URL in Keycloak?

The realm URL itself: `https://<host>/realms/<realm>`. It must match the `iss` claim in tokens exactly, including scheme and port.

Where are a realm’s public keys?

At the JWKS endpoint, `https://<host>/realms/<realm>/protocol/openid-connect/certs`. It lists the public keys that sign the realm’s tokens, each with a key id.

Why does /auth/realms return 404?

Since Keycloak 17 the default path has no `/auth` prefix. Remove it from the URL, or set `http-relative-path=/auth` if older clients still need it.

What is the Keycloak logout URL?

`https://<host>/realms/<realm>/protocol/openid-connect/logout`. Send `id_token_hint` and `post_logout_redirect_uri` with it to sign the user out and return them to your app.

Where is the Keycloak SAML metadata URL?

At `https://<host>/realms/<realm>/protocol/saml/descriptor`. Service providers read the realm’s entity id, endpoints and signing certificate from it.

Can one app accept tokens from two Keycloak realms?

Yes, but it must treat them as two issuers. Configure both issuer URLs and both JWKS URLs, and decide per request which realm issued the token by reading its `iss` claim.

What is the URL of the Keycloak account console?

`https://<host>/realms/<realm>/account`. Users can update their profile, password, second factors and sessions there, depending on the realm’s settings.

Rather not run Keycloak yourself?

We run it for you on a cluster of your own, with backups, upgrades and written support. Starter and Premium begin with a 7-day trial.