website/integrations/infrastructure/keycloak/index.mdx
import TabItem from "@theme/TabItem"; import Tabs from "@theme/Tabs";
Keycloak is an open-source Identity and Access Management (IAM) platform. It can be used both as an Identity Provider and as an application.
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.:::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. :::
Keycloak can be configured to use either OIDC or SAML for federated login sources. This guide covers both methods.
<Tabs defaultValue="oidc" values={[ { label: "Log in with OIDC", value: "oidc" }, { label: "Log in with SAML", value: "saml" }, ]}> <TabItem value="oidc">
To support the integration of Keycloak with authentik, you need to create an application/provider pair in authentik.
Log in to authentik as an administrator and open the authentik Admin interface.
Navigate to Applications > Applications and click Create with Provider 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.)
Strict redirect URI to https://keycloak.company/access/oidc/callback.https://keycloak.company/realms/<keycloak-realm-name>/protocol/openid-connect/logout/backchannel-logout.Back-channel.Click Submit to save the new application and provider.
Log in to Keycloak as an administrator.
Navigate to Configure > Identity Providers, click OpenID Connect v1.0 and set the following fields:
https://authentik.company/application/o/<slug>/.well-known/openid-configurationClick Submit.
To support the integration of Keycloak with authentik, you need to create an application/provider pair in authentik.
https://keycloak.company/realms/<keycloak-realm-name>/broker/saml/endpoint.authentik.Post.https://keycloak.company/realms/<keycloak-realm-name>/broker/saml/endpoint.Post.Back-channel (POST).https://keycloak.company/realms/<keycloak-realm-name>.https://authentik.company/application/saml/<slug>/metadata/To ensure that authentik is correctly integrated with Keycloak, log out and then log back in by clicking SAML or OIDC on the login screen. You should be redirected to authentik to log in, and if the process is successful, you'll be taken to the Keycloak dashboard.