keycloak

Application

keycloak/keycloak

Open source identity and access management for modern applications.

Overview

Keycloak provides authentication, user federation, strong authentication, user management, and fine-grained authorization. It secures applications and services with minimal effort, supporting OIDC and SAML protocols.

README Preview

\n\n\n[](https://bestpractices.coreinfrastructure.org/projects/6818)\n[](https://clomonitor.io/projects/cncf/keycloak)\n[](https://securityscorecards.dev/viewer/?uri=github.com/keycloak/keycloak)\n[](https://artifacthub.io/packages/olm/community-operators/keycloak-operator)\n\n\n[](docs/translation.md)\n\n# Open Source Identity and Access Management\n\nAdd authentication to applications and secure services with minimum effort. No need to deal with storing users or authenticating users.\n\nKeycloak provides user federation, strong authentication, user management, fine-grained authorization, and more.\n\n\n## Help and Documentation\n\n* [Documentation](https://www.keycloak.org/documentation.html)\n* [User Mailing List](https://groups.google.com/d/forum/keycloak-user) - Mailing list for help and general questions about Keycloak\n* Join [#keycloak](https://cloud-native.slack.com/archives/C056HC17KK9) for general questions, or [#keycloak-dev](https://cloud-native.slack.com/archives/C056XU905S6) on Slack for design and development discussions, by creating an account at [https://slack.cncf.io/](https://slack.cncf.io/).\n\n\n## Reporting Security Vulnerabilities\n\nIf you have found a security vulnerability, please look at the [instructions on how to properly report it](https://github.com/keycloak/keycloak/security/policy).\n\n\n## Reporting an issue\n\nIf you believe you have discovered a defect in Keycloak, please open [an issue](https://github.com/keycloak/keycloak/issues).\nPlease remember to provide a good summary, description as well as steps to reproduce the issue.\n\n\n## Getting started\n\nTo run Keycloak, download the distribution from our [website](https://www.keycloak.org/downloads.html). Unzip and run:\n\n    bin/kc.[sh|bat] start-dev\n\nAlternatively, you can use the Docker image by running:\n\n    docker run quay.io/keycloak/keycloak start-dev\n    \nFor more details refer to the [Keycloak Documentation](https://www.keycloak.org/documentation.html).\n\n\n## B

FAQ (5)

Troubleshooting
How to fix intermittent Oid4VciNonHaipTestSuite failure with VCIEnsureCredentialTimeClaimsNotLinkable iat linkability warning?

The flaky failure is caused by the probabilistic RANDOMIZE time-claim strategy: two independent random offsets can coincide, making iat2 - iat1 approximate the real issuance gap. Re-running usually passes, but the deterministic fix is to use ROUND with a MINUTE unit.

In tests/conformance/src/test/java/org/keycloak/tests/conformance/vci/VciConformanceRealmUtil.java, inside applyCommon(), replace the RANDOMIZE/300-second configuration with:

.attribute(OID4VCIConstants.TIME_CLAIMS_STRATEGY, TimeClaimNormalizer.Strategy.ROUND.name())
.attribute(OID4VCIConstants.TIME_ROUND_UNIT, TimeClaimNormalizer.RoundUnit.MINUTE.name())

Use MINUTE, not HOUR or DAY: credentials have a 300-second expiry, and 300 seconds is exactly five minute boundaries. Coarser units can round exp back to the rounded iat, causing credentials to be expired immediately. Rounding is an allowed unlinkability mitigation under RFC 9901 §10.1. Rebuild and rerun the Oid4VciNonHaipTestSuite conformance job.

GitHub Issue #53787
Troubleshooting
How to fix Keycloak ExternalLinksTest failing with HTTP 404 for the EntityManager API link?

Correct the EntityManager link in the server-development user-storage guide. Replace the lowercase path ending in /entitymanager with the case-sensitive /EntityManager.html. Verify the corrected URL returns HTTP 200, then rerun: ./mvnw install -Dtest=ExternalLinksTest -am -pl docs/documentation/tests -Pdocumentation.

GitHub Issue #53757
Troubleshooting
How to fix CVE-2026-91777 jackson-databind deserialization DoS vulnerability?

Upgrade com.fasterxml.jackson.core:jackson-databind to a patched version: **2.22.3**, **2.21.7**, or **2.18.11** (affected: 2.21.5, 2.22.1, 2.22.2 and earlier lines).

**Maven:**

<dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-databind</artifactId>
    <version>2.22.3</version>
</dependency>

**Gradle:**

implementation 'com.fasterxml.jackson.core:jackson-databind:2.22.3'

**Quarkus users:** the version is managed by quarkus-bom (e.g. 3.40.1 ships an affected version). Either upgrade to a newer quarkus-bom release that includes the fix, or pin the fixed jackson-databind version explicitly in your dependencyManagement section after the BOM import.

The vulnerability causes quadratic CPU consumption (N*(N+1)/2 identity comparisons) when deserializing JSON with @JsonIdentityInfo object IDs into Collection or Map types, where N forward references are resolved in reverse order — enabling denial of service with a shallow, linearly-sized payload. The patch replaces the repeated linear scan of the pending-reference accumulator with a keyed lookup structure.

**Mitigation if upgrade is impossible:** avoid deserializing untrusted/attacker-controlled JSON into identity-enabled (@JsonIdentityInfo) collections or maps, and enforce payload size limits at the API edge.

GitHub Issue #53388
Troubleshooting
Why does a Keycloak workflow condition using `!has-role()` run for the opposite users?

In Keycloak 26.8.0, workflow expressions support only not, and, and or. The ! character is silently dropped instead of causing a validation error, so if: "!has-role(vip)" is evaluated as if: "has-role(vip)", inverting the condition. Replace it with the supported operator: if: "not has-role(vip)". Likewise use and/or instead of &&/||. Search server logs for token recognition error at: '!' to identify affected workflows. A fix rejects unrecognized characters with workflowExpressionInvalid; upgrade to a release containing the PR "Reject workflow expressions with unrecognized characters" when available.

GitHub Issue #53790
Troubleshooting
How do I fix Keycloak Protection API creating a resource as owned by the resource server instead of the specified user?

This behavior is intentional in Keycloak 26.6.x. When you call POST /realms/{realm}/authz/protection/resource_set with a PAT, Keycloak ignores the request-body owner and assigns ownership to the PAT subject, typically the resource server. Updating the resource with PUT does not change the owner.

To create a resource owned by another user, use the Keycloak Admin API instead:

curl -X POST \
  "http://localhost:8080/admin/realms/{realm}/clients/{client-uuid}/authz/resource-server/resource" \
  -H "Authorization: Bearer $ADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Alice Resource",
    "owner": "{alice-user-id}",
    "ownerManagedAccess": true
  }'

Use the client's UUID, not its clientId, and an admin token with permission to manage authorization resources. Set ownerManagedAccess according to whether the user should manage the resource. The Protection API can only create resources for the subject represented by the presented PAT; arbitrary user ownership must now be done through the Admin API.

GitHub Issue #49910