Integrate with Directus
Support level: Community
What is Directus?
Directus connects to a database and provides REST and GraphQL APIs, a no-code interface, and a native MCP server.
Preparation
The following placeholders are used in this guide:
directus.companyis the FQDN of a self-hosted Directus installation.<project_url>.directus.appis the URL of a Directus Cloud project.authentik.companyis the FQDN of the authentik installation.
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.
Directus SSO requires a Team or Enterprise license, or an Open Innovation Grant. You can configure SSO directly on a self-hosted deployment. Directus Customer Success must configure SSO for an Enterprise Cloud project.
Before you begin, log in to Directus as an administrator. Navigate to Settings > User Roles, open the role that SSO users should receive, and note the role ID from the browser URL.
Choose your Directus deployment below.
- Self-hosted Directus
- Directus Cloud
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 self-hosted Directus with authentik, you need to 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 open the application wizard.
- 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 is 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 are required later.
- Add a Redirect URI of type
StrictAuthorizationwith a value ofhttps://directus.company/auth/login/authentik/callback. - Select any available signing key.
- Configure Bindings (recommended): create a binding (policy, group, or user) to control which users can access Directus and be registered automatically.
- Click Submit to save the new application and provider.
Directus configuration
The configuration enables automatic registration for users who can access the authentik application. Directus assigns those users the role that you specify.
-
Add the following environment variables to the Directus configuration. Replace
<Directus role ID>with the role ID that you noted during preparation..envPUBLIC_URL="https://directus.company"AUTH_PROVIDERS="authentik"AUTH_AUTHENTIK_DRIVER="openid"AUTH_AUTHENTIK_CLIENT_ID="<Client ID from authentik>"AUTH_AUTHENTIK_CLIENT_SECRET="<Client Secret from authentik>"AUTH_AUTHENTIK_ISSUER_URL="https://authentik.company/application/o/<application_slug>/.well-known/openid-configuration"AUTH_AUTHENTIK_ALLOW_PUBLIC_REGISTRATION="true"AUTH_AUTHENTIK_DEFAULT_ROLE_ID="<Directus role ID>"If Directus already uses other SSO providers, add
authentikto the comma-separatedAUTH_PROVIDERSvalue instead of replacing the existing providers. -
Restart Directus to apply the configuration.
Configuration verification
To confirm that authentik is properly configured with self-hosted Directus, open Directus and click Log in with authentik. You should be redirected to authentik and returned to Directus after authentication.
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 Directus Cloud with authentik, you need to 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 open the application wizard.
- 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 is 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 are required later.
- Add a Redirect URI of type
StrictAuthorizationwith a value ofhttps://<project_url>.directus.app/auth/login/authentik/callback. - Select any available signing key.
- Configure Bindings (recommended): create a binding (policy, group, or user) to control which users can access Directus and be registered automatically.
- Click Submit to save the new application and provider.
Directus configuration
Contact Directus Customer Success and ask them to configure OpenID Connect SSO for the Enterprise Cloud project with the following values:
- Provider name:
authentik - Client ID: Client ID from authentik
- Client secret: Client Secret from authentik
- Issuer URL:
https://authentik.company/application/o/<application_slug>/.well-known/openid-configuration - Automatic registration: enabled
- Default role ID: the Directus role ID that you noted during preparation
If the Cloud project already uses other SSO providers, ask Directus Customer Success to add authentik without replacing the existing providers.
Configuration verification
To confirm that authentik is properly configured with Directus Cloud, open Directus and click Log in with authentik. You should be redirected to authentik and returned to Directus after authentication.