Skip to main content

Integrate with Keycloak

Support level: Community

What is Keycloak?

Keycloak is an open-source Identity and Access Management (IAM) platform. It can be used both as an Identity Provider and as an application.

-- https://www.keycloak.org

Preparation

The following placeholders are used in this guide:

  • keycloak.company is the FQDN of the Keycloak installation.
  • authentik.company is the FQDN of the authentik installation.
  • <keycloak_realm_name> is the name of the Keycloak realm where users log in.
info

This documentation lists only the settings that you need to change from their default values. Be aware that any changes other than those explicitly mentioned in this guide could cause issues accessing your application.

Configuration methods

Keycloak supports OIDC and SAML identity providers. Select a protocol below and complete both the authentik and Keycloak configuration in that tab.

authentik configuration

Redirect URI changes in authentik 2026.5

In authentik versions earlier than 2026.5, all Redirect URIs are automatically treated as Authorization type. If you are using one of these older authentik versions, add only the Authorization URL to your Redirect URIs and do not configure a Post Logout URI.

To support the integration of Keycloak with authentik using OIDC, create an application/provider pair in authentik.

Create an application and provider

  1. Log in to authentik as an administrator and open the authentik Admin interface.

  2. Navigate to Applications > Applications and click New Application to create an application and provider pair. (Alternatively you can first create a provider separately, then create the application and connect it with the provider.)

    • Application: provide a descriptive name, an optional group for the type of application, the policy engine mode, and optional UI settings. Note the slug value because it will be required later.
    • Choose a Provider type: select OAuth2/OpenID Connect as the provider type.
    • Configure the Provider: provide a name (or accept the auto-provided name), the authorization flow to use for this provider, and the following required configurations.
      • Note the Client ID and Client Secret values because they will be required later.
      • Add a Redirect URI of type Strict Authorization as https://keycloak.company/realms/<keycloak_realm_name>/broker/authentik/endpoint.
      • Select any available signing key.
    • Configure Bindings (optional): you can create a binding (policy, group, or user) to manage the listing and access to applications on a user's Application Dashboard page.
  3. Click Submit to save the new application and provider.

Keycloak configuration

Create an OIDC identity provider

  1. Log in to Keycloak as an administrator.

  2. Select the realm where you want users to log in.

  3. Navigate to Identity Providers and click OpenID Connect v1.0.

  4. Set the following fields:

    • Alias: authentik
    • Display name: authentik
    • Discovery endpoint: https://authentik.company/application/o/<application_slug>/.well-known/openid-configuration
    • Client ID: enter the client ID from authentik.
    • Client Secret: enter the client secret from authentik.
  5. Click Save.

Configuration verification

To confirm that authentik is properly configured with Keycloak, open Keycloak and log in by selecting authentik on the login screen.

Resources