Skip to content
Back to skills

Keycloak Knowledge Patch

ASecurity

Keycloak

  • 25 stars
  • 0 votes
  • 0 copies
  • 9 views
  • Added September 5, 2026
developmentjavascriptrustgojavadockertestingapidatabasesecurity

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 7 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add Nevaberry/nevaberry-plugins --skill keycloak-knowledge-patch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Keycloak Knowledge Patch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Keycloak Knowledge Patch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nevaberry-keycloak-knowledge-patch/badge)](https://www.skillsdirectory.com/skills/nevaberry-keycloak-knowledge-patch)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: keycloak-knowledge-patch
description: Keycloak
version: "26.8.2"
license: MIT
metadata:
  author: Nevaberry
---



# Keycloak compatibility guidance

Load this skill when configuring Keycloak, upgrading deployments or extensions,
building authentication flows, or integrating its administration and token APIs.
Use the quick references below for common changes and the topic references for
complete conditions, examples, permissions, and release-specific behavior.

## Reference index

| Reference | Topics |
| --- | --- |
| [Admin, Account, and Organization APIs](references/admin-account-and-organizations.md) | Client API filters, account consent, delegated administration, organizations, SCIM, workflows |
| [Identity and Authentication](references/identity-and-authentication.md) | Flow construction, step-up, WebAuthn, session limits, profiles, LDAP, credentials, authorization |
| [Protocols, Token Exchange, and Brokering](references/protocols-token-exchange-and-brokering.md) | Standard and legacy exchange, delegation, scopes, brokering, client policies, logout, SSF |
| [Server, Operator, and Observability](references/server-operator-and-observability.md) | Configuration, containers, HTTP, TLS, databases, clustering, Operator, metrics, events |
| [Upgrades, Extensions, and Themes](references/upgrades-extensions-and-themes.md) | Session migration, imports, Java APIs, JavaScript adapters, testing, themes |

## Breaking changes and deprecations

- Replace `--features=dynamic-scopes` with `--features=parameterized-scopes`.
  Migrate custom `ClientScopeModel` code to the `parameterized` methods and
  constants. REST payloads use `parameterized.scope.type`; custom regexps use
  `parameterized.scope.regexp` without the scope-name prefix.
- Remove `--features=token-exchange-external-internal:v2` and use standard token
  exchange. Remove `spi-user-sessions--infinispan--use-batches` and
  `spi-user-sessions--infinispan--max-batch-size` from server configuration.
- Multi-cluster v1 (`--features=multi-site`) is deprecated in favor of
  `--features=stateless`. Multi-cluster v2 and `stateless` are supported, with
  `stateless` disabled by default.
- Volatile sessions, `clusterless`, and reliance on the route in the
  `AUTH_SESSION_ID` cookie for sticky sessions are deprecated. Deployments can
  opt out of session caching.
- **Full scope allowed**, legacy switches under **OpenID Connect Compatibility
  Modes**, and non-OIDC client registration providers are deprecated.
- The Realm Operator has reached end of life.
- In 26.8.0, client private keys are no longer stored in the database, and the
  endpoints that generate them are deprecated.
- Custom providers must migrate away from the removed
  `IdentityProviderModel.getOrganizationId()` with multiple organization links.
- The `view-system` role was removed. Full server information requires a trusted
  user or service account in the `master` realm with `manage-realm`.
- Admin REST updates cannot change an existing identity provider alias and return
  HTTP 400 for such attempts. Choose the alias when creating the provider.

For migration details, load the upgrades reference and the relevant API reference.

### Sessions, adapters, and extension migrations

To preserve online sessions when moving to 26, first complete the migration to
database-backed sessions in 25. Version 26 clears caches when moving to Infinispan
Protostream, so memory-only sessions are lost. Persistent sessions no longer have
the previous two-minute idle-timeout grace period; add two minutes to realm
session and client idle timeouts if preserving the effective timeouts is needed.

Install `keycloak-js` with the app or self-host the ES module. The server's `/js/`
adapter files, UMD global, and theme `keycloakJsUrl` are gone. Use HTTPS or localhost,
pass client configuration explicitly, and await `login()`, `createLoginUrl()`, and
`createRegisterUrl()`. Migrate OIDC logout callers from `redirect_uri` to
RP-Initiated Logout with `post_logout_redirect_uri`.

A session's transaction can start only once. The server starts it before the REST
endpoint even if a filter created the session. An asynchronous endpoint's initiating
`KeycloakSession` closes immediately; asynchronous work needs its own session and
transaction management.

### Credentials and security-sensitive API changes

Allow at least 86 characters for newly generated client secrets. Supported secret
rotation uses client policies to keep up to two secrets active during a transition.
Disabling rotation invalidates the previously rotated OIDC secret. Admin REST
suppresses Vault-resolved rotated secret values.

The Admin API checks access-token audience. Dynamic Client Registration protects
built-in identity and role claims such as `sub`, `aud`, and `realm_access.roles`
from registered protocol mappers, and rejects OIDC-to-SAML protocol changes
authorized by a Dynamic Client Registration access token. A Client Registration
GET authorized only by `view-clients` no longer returns the confidential secret.

Automatic account linking by email and organization domain checks require verified
brokered email. SAML Holder-of-Key assertions require proof of key possession;
the broker honors upstream `ProxyRestriction` when deciding whether it can issue
a downstream assertion. With `starttls=true`, SMTP requires TLS before credentials
or mail are sent.

## Authentication flows and step-up

A **Required** execution skips **Alternative** siblings at the same level. Put
alternatives in a separate subflow when another step must always run. A
**Conditional** subflow acts as **Required** only when all conditions pass; it is
**Disabled** when any condition fails or there are no conditions.

The built-in **Browser - Conditional 2FA** uses **Condition - credential** to skip
2FA after passwordless WebAuthn. Set the disabled **WebAuthn Authenticator** or
**Recovery Authentication Code Form** executions to **Alternative** to offer them.
For a passwordless Browser flow, place **WebAuthn Passwordless Authenticator** and
a password-and-OTP subflow as **Alternative** siblings in a **Required** subflow
after **Username Form**. Enable and assign **WebAuthn Register Passwordless** for
passkey enrollment; require **Password Form** and **OTP Form** in the password branch.

Order **Conditional - Level Of Authentication** subflows from lowest to highest.
The first level runs on fresh login regardless of the requested level; keep levels
cumulative and consistent across flows. **Max Age** is in seconds; `0` limits the
level to the current authentication. `acr_values=gold` is nonessential; an essential
`acr` request uses the `claims` parameter and errors if no listed ACR can be supplied.

The supported `step-up-authentication-saml` feature lets a service provider request
an authentication context class. When enabling it after realm creation or migration,
create and assign the `AuthnContextClassRef` scope and mapper manually.

Put **User session count limiter** after user identification in each applicable
Browser, Direct Grant, Reset Credentials, and Post Broker Login flow. CIBA is outside
its supported flows. Per-user realm and client maxima are independent; `0` disables
the corresponding check. Reaching the concurrent session limit is excluded from
brute-force login failure counts.

## Standard token exchange and delegation

`token-exchange-standard:v2` is enabled on the server by default. A same-realm
confidential requester must enable **Standard token exchange** and authenticate.
The subject access token must list the requester in `aud` or have been issued to it;
**Consent required** clients need prior consent for all requested scopes.

`scope` adds optional scopes to requester defaults. `audience` filters audiences
and client roles; scopes without client-role mappings survive that filter.
Repeat `audience` for multiple clients. Every requested audience must be available
from resolved scopes or the request fails. Neither V1 nor V2 supports `resource`.

Exchange can issue scopes and audiences absent from the subject token by default.
Apply `downscope-assertion-grant-enforcer` to limit scopes to already granted ones.
Only the original recipient can exchange a DPoP- or mTLS-bound subject token, using
a valid DPoP proof or matching certificate. Standard exchange requires the client
certificate when the requester is configured to receive mTLS-bound access tokens.

For refresh tokens, set **Allow refresh token in Standard Token Exchange** to
**Same session** and request `urn:ietf:params:oauth:token-type:refresh_token`.
The existing user session must be online and non-transient; omit `offline_access`.
Revocation of a still-valid subject token invalidates the exchange chain's refresh
tokens, while exchanged access tokens expire independently. Refresh fails when the
audience client is disabled, and exchanged tokens have finite expiration.

Delegation is preview and uses Fine-Grained Admin Permissions V2 exclusively.
Admin delegation uses `delegation:user` with **Users → delegate** or
**Groups → delegate-members** with a policy selecting the permitted actor.
The optional `delegation:client` scope supports consent for
a client acting on a user's behalf; `act` identifies that client without granting
Admin API access. Standard exchange rejects subject tokens with delegation claims.

## Administration, organizations, and provisioning

Enable the Client Admin API v2 preview with `--features=client-admin-api:v2` or
`--features=preview`. Its Operator resources `KeycloakOIDCClient` and
`KeycloakSAMLClient` are also preview. The API exposes an OpenAPI specification on
the management interface and supports declarative OIDC and SAML client management.

On `GET /admin/api/{realmName}/clients/v2`, `q` uses a subset of SCIM filter syntax
with case-sensitive strings. Invalid syntax, fields, or unsupported operators return
HTTP 400 with a JSON `error`. `fields` projects the response after full-client filtering.

Account consent `POST` and `PUT` both upsert and require `manage-account` or
`manage-consent`. Supply realm client scope IDs, or the internal client ID for its
own consent-requiring scope; unknown or parameterized scope IDs return HTTP 400.
Read, delete, feature-gate, and representation rules are in the account reference.

Members inherit realm and client roles assigned to organization groups. Enable
**Add group role mappings** on the **Organization Group Membership** mapper for roles per organization
in `organization`. A shared identity provider can link to several organizations;
auto-membership requires the organization to claim the user's email domain. New
links default to Unmanaged membership; existing links migrate as Managed.

SCIM is supported and handles multivalued user attributes. Reads and writes enforce
User Profile permissions; search filters respect Fine-Grained Admin Permissions.
Use `name.formatted` in user representations instead of the earlier `name.formated`.
Supported YAML workflows automate resource lifecycles; `invite-user` sends an
action-token email on user creation, defaulting to password update and verification.

## Server configuration and operation

Use `KCRAW_` for literal `$`, `$$`, and `${…}` values. Defining both `KC_` and
`KCRAW_` for the same key fails startup. Pair `KC_<name>` with `KCKEY_<name>` when
automatic underscore mapping would change the intended key.

`kc.sh build` persists build options in plaintext even from the Java KeyStore source.
Supply secrets such as `db-password` at runtime. Run `kc.sh build` before
`start --optimized`; changed build options require rebuilding. Fix provider JAR
timestamps before building optimized containers if Docker changes their timestamps.

Set `http-max-queued-requests` to bound the otherwise unbounded pending queue;
excess requests immediately receive HTTP 503. During asynchronous bootstrap,
startup and liveness may be `UP` while readiness is `DOWN`. Use `/health/ready`
for load-balancer checks, or `--server-async-bootstrap=false` to defer listeners.

Multi-cluster v2 uses embedded Infinispan, a synchronously replicated database as
the source of truth, and load-balancer outage detection, removing external cache
and fencing requirements. Login failures persist in the database by default;
`multi-site` and `clusterless` deployments still use external Infinispan for them.

## Additional protocol features

Identity Brokering API V2 is supported and opt-in; deprecated V1 is enabled by
default. V2 uses authenticated confidential-client `POST` requests, **Allow retrieve
external tokens**, and an identity provider allowlist in place of per-user broker roles.

OID4VCI is preview through `--features=oid4vc-vci` or `--features=preview`.
Revoking a refresh token can revoke issued credentials. Wallet presentation support
through `--features=oid4vc-vp`, mdoc through `--features=oid4vc-mdoc`, and the separate
REST credential offer endpoint through `--features=oid4vc-vci-rest-credential-offer`
are experimental. Load the identity reference for attestation and refresh intervals.

`--features=identity-assertion-jwt` enables experimental receiving-side ID-JAG.
`--features=ssf` enables experimental signed Security Event Token transmission with
push or poll delivery; each realm opts in individually. `--features=authzen` exposes
experimental single and batch authorization evaluation endpoints.

Files in this skill

  • SKILL.md9.1 KB
  • coverage.json1016 B
  • references/admin-account-and-organizations.md5.1 KB
  • references/identity-and-authentication.md5.9 KB
  • references/protocols-token-exchange-and-brokering.md6.7 KB
  • references/server-operator-and-observability.md10.4 KB
  • references/upgrades-extensions-and-themes.md4.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.