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.
Preparation
The following placeholders are used in this guide:
keycloak.companyis the FQDN of the Keycloak installation.authentik.companyis the FQDN of the authentik installation.<keycloak_realm_name>is the name of the Keycloak realm where users log in.
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.
- OIDC
- SAML
authentik configuration
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
-
Log in to authentik as an administrator and open the authentik Admin interface.
-
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
StrictAuthorizationashttps://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.
-
Click Submit to save the new application and provider.
Keycloak configuration
Create an OIDC identity provider
-
Log in to Keycloak as an administrator.
-
Select the realm where you want users to log in.
-
Navigate to Identity Providers and click OpenID Connect v1.0.
-
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.
- Alias:
-
Click Save.
authentik configuration
To support the integration of Keycloak with authentik using SAML, create an application/provider pair in authentik.
Create an application and provider
authentik 2026.5 introduces changes to how the SAML provider behaves. Specifically, the provider now automatically sets the Issuer value to: https://authentik.company/application/saml/<application_slug>/metadata/
Older versions of authentik set this value to authentik by default. If you're running an older version, please set Issuer to https://authentik.company/application/saml/<application_slug>/metadata/, where <application_slug> is the slug that you selected for the application.
-
Log in to authentik as an administrator and open the authentik Admin interface.
-
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 SAML Provider 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.
- Set the ACS URL to
https://keycloak.company/realms/<keycloak_realm_name>/broker/authentik/endpoint. - Set the SLS URL to
https://keycloak.company/realms/<keycloak_realm_name>/broker/authentik/endpoint. - Set the SLS Binding to
Post. - Set the Logout Method to
Back-channel (POST). - Set the Audience to
https://keycloak.company/realms/<keycloak_realm_name>. - Under Advanced protocol settings, set Signing Certificate to use any available certificate.
- Set the ACS URL to
- 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.
-
Click Submit to save the new application and provider.
Keycloak configuration
Create a SAML identity provider
-
Log in to Keycloak as an administrator.
-
Select the realm where you want users to log in.
-
Navigate to Identity Providers and click SAML v2.0.
-
Set the following fields:
- Alias:
authentik - Display name:
authentik - Service provider entity ID:
https://keycloak.company/realms/<keycloak_realm_name> - Use metadata descriptor URL: enable this option.
- Metadata descriptor URL:
https://authentik.company/application/saml/<application_slug>/metadata/
- Alias:
-
Click Add.
Configuration verification
To confirm that authentik is properly configured with Keycloak, open Keycloak and log in by selecting authentik on the login screen.