Technical Documentation: goauthentik/authentik
ℹ️ Provenance: Multi-Tier Ingestion · CodeWiki Reference
Overview (README.md)
What is authentik?
authentik is an open-source Identity Provider (IdP) for modern SSO. It supports SAML, OAuth2/OIDC, LDAP, RADIUS, and more, designed for self-hosting from small labs to large production clusters.
Our enterprise offering is available for organizations to securely replace existing IdPs such as Okta, Auth0, Entra ID, and Ping Identity for robust, large-scale identity management.
Installation
- Docker Compose: recommended for small/test setups. See the documentation.
- Kubernetes (Helm Chart): recommended for larger setups. See the documentation and the Helm chart repository.
- AWS CloudFormation: deploy on AWS using our official templates. See the documentation.
- DigitalOcean Marketplace: one-click deployment via the official Marketplace app. See the app listing.
Screenshots
| Light | Dark |
|---|---|
Development and contributions
See the Developer Documentation for information about setting up local build environments, testing your contributions, and our contribution process.
When you contribute documentation, either to accompany a code change or as a standalone contribution, please be sure to follow our documentation Style Guide.
Security
Please see SECURITY.md.
Adoption
Using authentik? We'd love to hear your story and feature your logo. Email us at [email protected] or open a GitHub Issue/PR!
License
Index (`website/docs/index.mdx`)
title: Welcome to authentik
What is authentik?
authentik is an IdP (Identity Provider) and SSO (Single Sign-On) platform that is built with security at the forefront of every piece of code and every feature, with an emphasis on flexibility and versatility.
With authentik, site administrators, application developers, and security engineers have a dependable and secure solution for authentication in almost any type of environment. There are robust recovery actions available for the users and applications, including user profile and password management. You can quickly edit, deactivate, or even impersonate a user profile, and set a new password for new users or reset an existing password.
You can use authentik in an existing environment to add support for new protocols, so introducing authentik to your current tech stack doesn't present re-architecting challenges. We support all of the major providers, such as OAuth2, SAML, LDAP, and SCIM, so you can pick the protocol that you need for each application.
We offer two versions of authentik: the forever-free open source project upon which everything is built, and our source available Enterprise version, with a Support center and additional features.
User-focused & task-oriented dashboards
The authentik product provides the following consoles:
Flow interface: Flows are the steps by which the various Stages of a login and authentication process occur. A stage represents a single verification or logic step in the sign-on process. authentik allows for the customization and exact definition of these flows.
User interface: this console view in authentik displays all of the applications and integrations in which you have implemented authentik. Click on the app that you want to access to open it, or drill down to edit its configuration in the admin interface.
Admin interface: a visual tool for the creation and management of users and groups, tokens and credentials, application integrations, events, and the Flows that define standard and customizable login and authentication processes. Easy-to-read visual dashboards display system status, recent logins and authentication events, and application usage.
In authentik, you can use Light or Dark mode for the Flow interface, User interface, and the Admin interface.
import useBaseUrl from "@docusaurus/useBaseUrl";
import ReactBeforeSliderComponent from "react-before-after-slider-component";
import "react-before-after-slider-component/dist/build.css";
<ReactBeforeSliderComponent
firstImage={{
imageUrl: useBaseUrl("img/screen_flow_dark.jpg"),
}}
secondImage={{
imageUrl: useBaseUrl("img/screen_flow_light.jpg"),
}}
/>
<ReactBeforeSliderComponent
firstImage={{
imageUrl: useBaseUrl("img/screen_apps_dark.jpg"),
}}
secondImage={{
imageUrl: useBaseUrl("img/screen_apps_light.jpg"),
}}
/>
<ReactBeforeSliderComponent
firstImage={{
imageUrl: useBaseUrl("img/screen_admin_dark.jpg"),
}}
secondImage={{
imageUrl: useBaseUrl("img/screen_admin_light.jpg"),
}}
/>
Documentation
Our tech docs cover the typical topics, from installation to configuration, adding providers, defining policies and creating login flows, event monitoring, security, and attributes. Enterprise version documentation is included here, within our standard tech docs.
For information about integrating a specific application or software into authentik, refer to our Integrations section, accessible from the top menu bar.
For developer-focused documentation, such as using our APIs and blueprints, setting up your development environment, translations, or how to contribute, refer to the Developer area, accessible from the top menu bar.
Installation
Refer to the installation steps for either Docker Compose or Kubernetes.
For more information about configuration, beta versions, and additional installation options, see our main Installation section.
Customize Index (`website/docs/customize/index.mdx`)
title: Customize your instance sidebar_label: Overview sidebar_position: 0
You can customize the behavior, look, and available resources for your authentik instance. For more information, refer to each of the topics below:
import DocCardList from "@theme/DocCardList";
Developer Docs Index (`website/docs/developer-docs/index.mdx`)
title: Developer Documentation
import DocCardList from "@theme/DocCardList";
We're thrilled you're here! 🎉 Thanks for jumping in to contribute to authentik; your ideas, fixes, and features make a real impact. Pick a topic below to dive in and have fun hacking! 🚀 Even small PRs and typo fixes are hugely appreciated.
Endpoint Devices Index (`website/docs/endpoint-devices/index.mdx`)
title: Endpoint Devices sidebar_label: Overview sidebar_position: 0 authentik_version: "2025.12.0"
import DocCardList from "@theme/DocCardList";
:::danger Early preview
The endpoint devices feature set is currently in early preview and in development. It is not recommended for production use.
The features, methods, and even the name are yet to be confirmed.
Breaking changes and bugs should be expected.
:::
:::info Enterprise License Required
An enterprise license is required to access some of these features, refer to the current features overview table below for more details.
During this early preview stage, short trial licenses are available for testers. Please contact us via [email protected] for more details.
:::
What are endpoint devices?
Endpoint devices are end-user devices or servers that are registered with authentik.
There are two purposes for registration: Device authentication and Device compliance.
Devices can be registered by installing the authentik Agent which supports:
- Device compliance by reporting information about endpoint devices to authentik.
- Local device login with authentik credentials.
- Connecting via SSH to endpoint devices with authentik credentials.
- Authenticating to CLI applications such as kubectl and AWS with authentik credentials.
Alternatively, Connectors allow authentik to be integrated with third-party services such as Fleet. This allows for device information to be reported to authentik for Device compliance purposes.
Why use endpoint devices?
Endpoint devices offers administrators an alternative to traditional device authentication systems like LDAP for Linux or Active Directory for Windows, while supporting modern MFA methods like FIDO2. This feature set allows authentik to act as a unified authentication platform for devices, servers, and applications.
Meanwhile, Device Compliance allows administrators to make informed decisions about access to applications by verifying device security requirements, like operating system and application versions, before granting access to applications.
Features overview
| Feature | Linux | Windows | macOS | Status |
|---|---|---|---|---|
| Local device login | :ak-enterprise | :ak-enterprise | :ak-enterprise | Available for early preview on Windows and Linux. |
| SSH authentication | Open source | Open source | Open source | Available for early preview. Only supports Linux SSH targets. |
| Device compliance | Open source | Open source | Open source | Available for early preview. |
| Advanced device compliance | :ak-enterprise | :ak-enterprise | :ak-enterprise | In development. |
| authentik Agent | Open source | Open source | Open source | Available for early preview. |
| Fleet Connector | :ak-enterprise | :ak-enterprise | :ak-enterprise | Available for early preview. |
| Other Connectors (Entra, Intune, Cloudflare WARP etc) | :ak-enterprise | :ak-enterprise | :ak-enterprise | In development. |
How to provide feedback and report bugs
Report issues via our GitHub. Please include as much information as possible to assist us in troubleshooting.
More information
For more information, refer to each of the topics below:
Enterprise Index (`website/docs/enterprise/index.mdx`)
title: authentik Enterprise sidebar_position: 0
import { EnterpriseCTA } from "./EnterpriseCTA";
authentik Enterprise adds features for identity provisioning, security, compliance, and device access to your self-hosted deployment. Enable them by installing a license key. Enterprise uses the same container images and upgrade process as the open source version.
Licenses are validated locally, so Enterprise also works in air-gapped environments.
Set up and manage Enterprise
- Get started to obtain and install a license on a new or existing deployment.
- Explore Enterprise features and follow their configuration guides.
- Manage licenses and billing to check user capacity, replace a license key, or manage your Customer Portal organization.
- Get Enterprise support to open a ticket and share diagnostic information.
Choose a plan
Enterprise and Enterprise Plus include the same product features. Support and purchase options depend on your plan and subscription; see plan details.
Install Config Index (`website/docs/install-config/index.mdx`)
title: Installation and Configuration sidebar_label: Overview sidebar_position: 0
Everything you need to get authentik up and running!
The installation process is the same for the open-source edition and authentik Enterprise. To enable Enterprise features, get started with authentik Enterprise after installing authentik.
For information about upgrading to a new version, refer to the Upgrade section in the relevant Release Notes and to our Upgrade authentik documentation.
import DocCardList from "@theme/DocCardList";
Add Secure Apps Access Requests Index (`website/docs/add-secure-apps/access-requests/index.mdx`)
title: Access requests sidebar_label: Access requests authentik_enterprise: true authentik_version: "2026.8" authentik_preview: true
About access requests
Access requests allow users to request access to an application when they need it, rather than requiring an administrator to provision access in advance.
Each request is evaluated against configured request rules and routed to one or more reviewers. When approved, access is granted for a defined period and expires automatically.
This supports just-in-time and least-privilege access models. Users retain minimal standing access and request elevated access only when necessary, while authentik records every request and decision for auditing.
Access requests provide:
- A self-service way for users to request access through the user interface.
- Rule-based routing to the appropriate reviewers.
- Time-limited access grants that expire automatically, without manual cleanup.
- Audit events for request creation, approval, and denial.
Terminology
| Term | Description |
|---|---|
| Access request | A request from a specific user for access to an application. A request can be pending, approved, or denied. |
| Request rule | A configuration that determines which request flow is used, who reviews requests, and how reviewers are notified. If no request flow is set on the request rule, it falls back to the request flow value set on the brand. |
| Request rule binding | A binding between a request rule and a requestable application. It also determines which users or groups can request access. |
| Reviewer | A user or group authorized to approve or deny an access request. |
| Expiry | The period for which access granted through an approved request remains valid. |
Access request lifecycle
- A user logs in to authentik, opens the Discover page, and selects a requestable application, optionally also choosing an application entitlement.
- authentik creates the access request and evaluates it against the request rules bound to the selected application.
- authentik runs the configured request flow, if any, to collect required information such as a justification.
- The assigned reviewers are notified based on the request rule's configuration, and the request appears in their pending-request queue.
- A reviewer approves or denies the request. Requesters cannot approve their own requests.
- If approved, authentik grants access to the application and starts the expiry timer.
- When the access period ends, authentik automatically revokes access.
Request rules
Request rules determine whether a request flow is used, who reviews requests, and how reviewers are notified. Users, groups, and policies are bound to a request rule to determine who is authorized to review access requests.
Request rules are bound to an application, which makes the application requestable via the Discover page in the user interface. Users, groups, and policies can be bound to request rule bindings to determine which users are eligible to request access to the application. If a request rule binding has no users, groups, or policies bound to it, every user is eligible to request access to the application, following the same convention as application access. Reviewer eligibility works differently: a request rule with no users, groups, or policies bound to it has no one who can approve requests against it.
Request flows
Submitting a request executes a request flow. Use this to collect a justification, require re-authentication or MFA before elevation, or run policies against the requester.
Configure a Request flow on either:
- The request rule itself.
- As a default for the brand. Used as a fallback when the request rule does not specify a request flow.
authentik includes a default-request flow that is empty. This flow can be configured with any required stages and policies. Any prompt data entered by a requester during a request flow is shown to the reviewer in the Requester notes field. Request flows can be left empty if you don't require user interaction.
Configure access requests
Create a request rule
- Log in to authentik as an administrator and open the Admin interface.
- Navigate to Applications > Request rules.
- Click New Request Rule and set the following fields:
- Rule Name: The name for the rule.
- Minimum reviewers: The minimum number of reviewers who must approve a request.
- Minimum reviewers is per-group (optional): When enabled, fulfilling the request requires at least that many reviewers from each of the reviewer groups bound to this rule. When disabled, the value is a total across all reviewer groups.
- Notify: Select one of the following options to determine who is notified of new access requests:
- Everyone who can approve
- Only individually-selected reviewers
- A random subset (of size “minimum reviewers”) of everyone who can approve
- Notification transports (optional): The notification transports used to notify reviewers.
- Request flow (optional): The request flow presented to the user when requesting access.
- Click Create Request Rule.
Define users or groups to review access requests
- Log in to authentik as an administrator and open the Admin interface.
- Navigate to Applications > Request rules.
- Expand the request rule by clicking the chevron (>) next to its name.
- Click Create or bind....
- Select the users, groups, or policies that will review access requests for that request rule.
You can bind as many users, groups, and policies as necessary.
Make an application requestable
- Log in to authentik as an administrator and open the Admin interface.
- Navigate to Applications > Applications and click the application name that you want to make requestable.
- Open the Request rules tab, click Create or bind..., then select Bind existing rule
- Rule: The request rule that is used.
- Pending expiry: How long a request against this binding stays pending before it automatically lapses if not approved or denied.
- Maximum granted expiry: The maximum duration a grant approved against this binding can last. Requesters can ask for less, but never more.
- Additional entitlements (optional): Application entitlements granted alongside access to this object when a request is approved.
- Click Create Request Rule Binding.
Define users or groups that can request access to the application
- Log in to authentik as an administrator and open the Admin interface.
- Navigate to Applications > Applications and click the application name that you want to make requestable.
- Open the Request rules tab, and expand a request rule by clicking the chevron (>) next to its name.
- Click Create or bind....
- Select the users, groups, or policies that can request access to the application via that request rule.
You can bind as many users, groups, and policies as necessary.
Verify the configuration
- Log in as a test user who does not have access to the application.
- Open the Discover page and confirm that the application is offered as requestable.
- Click the application, submit an access request, and confirm that it appears in the reviewer's queue.
- Approve it, confirm that access is granted, and that the corresponding events are recorded.
Requester experience
Requesting access
Users see requestable applications as cards on the Discover page of the user interface under the Browse tab. Selecting a card opens the request dialog and runs the configured request flow.
View pending requests
Users can view their pending access requests under the My Requests tab on the Discover page.
Reviewer experience
Approving and denying access requests
Reviewers see pending requests on the Discover page of the user interface under the For My Review tab. The requester, the requested application, and the time since the request was made are listed.
Reviewers click the Review button and can approve or deny the request, and optionally add Notes before clicking the Submit button. Reviewers also see any prompt data that a requester entered in the request flow, in the Requester notes field.
Admin interface
Administrators can view all access requests via the access requests page (Applications > Access Requests). Each row represents an access request and shows the request's: requester, creation date and time, requested application, and status. Each access request can be expanded by clicking its chevron (>) to show Requester Data and Targets. This is all the prompt data that the requester entered during the request flow, for example a justification for why the require access.
If the administrator account is set as a reviewer in the associated request rule, they can click Fulfill and approve or deny the access request.
Events and auditing
Each stage of a request is recorded as an event and can be matched in event matcher policies:
access_request_createdaccess_request_approvedaccess_request_deniedaccess_request_revoked
Pair an event matcher policy with a notification rule to alert security teams of access events via Slack, email, or webhooks. See Events and Notifications for more information.
Considerations and limitations
- A user cannot approve their own request.
- Approved access is time-bound; plan expiry durations so that they match how long the work actually takes.
- Request rules depend on policies. A misconfigured policy can leave requests with no eligible reviewer.
Troubleshooting
| Symptom | Cause and resolution |
|---|---|
| An application does not appear as requestable. | The user is not bound to the request rule binding on the application. |
| A request has no reviewers. | No rule is bound to the application, the bound policies did not pass, or the only matched reviewer is the requester. |
| A reviewer cannot action a request. | The reviewer is the requester, or is not matched by the request rule's bindings. |
Add Secure Apps Applications Index (`website/docs/add-secure-apps/applications/index.mdx`)
title: Applications sidebar_position: 1
Applications, as defined in authentik, are used to configure and separate the authorization/access control and the appearance of a specific software application in the Application Dashboard page.
When a user logs into authentik, they see a list of the applications for which authentik is configured to provide authentication and authorization (the applications that they are authorized to use).
Applications are the "other half" of providers. They typically exist in a 1-to-1 relationship; each application needs a provider and every provider can be used with one application. Applications can, however, use specific, additional providers to augment the functionality of the main provider. For more information, see Backchannel providers.
Furthermore, the RAC (Remote Access Control) feature uses a single application and a single provider, but multiple "endpoints". An endpoint defines each remote machine.
:::info
For information about creating and managing applications, refer to Manage applications.
:::
Appearance
Applications are displayed to users when:
- The user has access defined via policies (or the application has no policies bound)
- A valid Launch URL is configured/could be guessed, this consists of URLs starting with http:// and https://
The following options can be configured:
Name: This is the name shown for the application card
Launch URL: The URL that is opened when a user clicks on the application. When left empty, authentik tries to guess it based on the provider
You can use placeholders in the launch URL to build them dynamically based on the logged-in user. For example, you can set the Launch URL to
https://goauthentik.io/%(username)s, which will be replaced with the currently logged-in user's username.For a reference of all fields available, see the API schema for the User object.
Only apps with launch URLs that begin with
http://orhttps://, or that use relative paths, appear on the user's Application Dashboard page. To keep an app accessible but remove it from that page, use the Hide from Application Dashboard option (see Hide applications).Icon (URL): Optionally configure an icon for the application. You can select from files uploaded to the Files library or enter an absolute URL.
Publisher: Text shown in the application card's expandable kebab menu (⋮)
Description: Text shown in the application card's expandable kebab menu (⋮)
Add Secure Apps Bindings Overview Index (`website/docs/add-secure-apps/bindings-overview/index.mdx`)
title: Bindings in authentik sidebar_position: 4 sidebar_label: "Bindings"
A binding connects one authentik object to another object that uses it. Bindings let authentik answer two common questions:
- Where should authentik evaluate this policy, user, or group?
- Where should authentik insert this stage into a flow?
A policy answers "should this request pass?" A policy binding decides where authentik asks that question.
For a step-by-step guide, see Work with bindings.
Binding types
The two most common binding types are policy bindings and flow-stage bindings.
- Policy Bindings attach a policy, user, or group to a target that supports policy binding.
- Flow-stage bindings attach a stage to a flow and define where that stage runs.
Use a policy binding when you want to control whether a target is allowed, denied, or shown. Use a flow-stage binding when you want to place a stage into a flow and decide when it should run.
Where bindings are used
The policy binding system is shared by several authentik objects. You can bind policies, users, and groups to these targets:
| Target | What the binding controls |
|---|---|
| Flow | Whether the user can start or continue using the flow. |
| Flow-stage binding | Whether a specific stage applies to a user in that flow. |
| Application | Whether the user can view and access the application. |
| Application entitlement | Whether the user has access to an entitlement. |
| Source | Whether the source can be used for login or enrollment. |
| Device | Whether the device passes the configured access checks. |
| Device access group | Whether the device is part of the access group. |
| Notification rule | Whether the notification rule applies. |
| RAC endpoint | Whether the user can access the Remote Access endpoint. |
Stages themselves are not policy binding targets. A stage is attached to a flow through a flow-stage binding, so when you bind a policy to a stage in a flow, you are binding it to that flow-stage binding.
Because of this, the same stage can be reused in multiple flows, and each flow can apply different policies, users, groups, order, and evaluation settings to that stage.
Relationships
flowchart TD
subgraph Directory
user[User]
group[Group]
end
subgraph Policy
policy[Policy]
policy_binding[Policy binding]
end
subgraph Application
application[Application]
application_entitlement[Application entitlement]
end
subgraph Sources
source[Source]
end
subgraph Endpoint devices
device[Device]
device_access_group[Device access group]
end
subgraph Events
notification_rule[Notification rule]
end
subgraph RAC provider
endpoint[Endpoint]
end
subgraph Flows
flow[Flow]
flow_stage_binding[Flow-stage binding]
stage[Stage]
end
policy --> policy_binding
user --> policy_binding
group --> policy_binding
policy_binding --> application
policy_binding --> application_entitlement
policy_binding --> source
policy_binding --> device
policy_binding --> device_access_group
policy_binding --> notification_rule
policy_binding --> flow
policy_binding --> endpoint
flow_stage_binding --> stage
flow --> flow_stage_binding
policy_binding --> flow_stage_bindingPolicy bindings
A policy binding attaches one policy, user, or group to a target:
- A policy object can evaluate runtime data, request context, source data, user attributes, and other conditions.
- A user binding passes when the current user matches that user.
- A group binding passes when the current user is a member of that group.
User and group bindings are useful when you want a direct allow or deny rule without creating a separate policy object.
Policy bindings are commonly used with applications, sources, flows, flow-stage bindings, and application entitlements. For example, you can bind a group directly to an application so that only members of that group can view and launch the application.
Bindings are evaluated according to the target's Policy engine mode:
Any: the target passes when any binding passes.All: the target passes only when every binding passes.
authentik evaluates enabled bindings in ascending order. This order is most noticeable when you read logs or combine multiple policies that return messages.
Bindings also support these options:
- Negate, which flips the pass or fail result of the binding.
- Timeout, which limits how long authentik waits for policy execution.
- Failure Result, which controls whether a policy error is treated as pass or fail.
Policy bindings attached directly to a flow are evaluated before the flow starts. In authentication and enrollment flows, that usually means that user- and group-based checks on the flow itself cannot pass until the user has already been identified elsewhere.
If a target has no applicable bindings, authentik treats the result as passing.
Flow-stage bindings
A flow-stage binding attaches a stage to a flow and defines the order in which that stage runs. Flow-stage bindings are also called stage bindings.
authentik uses flow-stage bindings while building the flow plan. The flow plan determines which stages a user sees and in what order.
This matters because stages are reusable objects. The same stage can appear in multiple flows, but each flow-stage binding can have its own settings. When you bind a policy to a stage in a specific flow, you bind it to that flow-stage binding, not to the reusable stage definition itself.
Stage-binding policy evaluation
Flow-stage bindings have two policy evaluation options:
- Evaluate when flow is planned: authentik evaluates policies while building the flow plan.
- Evaluate when stage is run: authentik evaluates policies immediately before presenting the stage.
At least one of these options must be enabled, and both can be enabled at the same time. For the full behavior and guidance on choosing the right setting, see Flow Planner.
What to remember
- Stages are attached to flows through flow-stage bindings.
- Policies, users, and groups can all be bound through the same policy binding system.
- The same stage can behave differently in different flows because each flow-stage binding has its own settings and bindings.
- A policy bound directly to a flow is evaluated earlier than a policy bound to a flow-stage binding.
Common examples
Restrict an application
By default, applications are accessible to all users. Bind a group or policy to an application when you want to limit access to specific users.
Run a stage only for some users
Bind a policy, user, or group to the flow-stage binding when a stage should appear only for certain users in that flow. For example, require an MFA stage only for specific users.
Scope access inside an application
Use application entitlements when you need to control access to parts of an application after the user already has access to the application. For example, control which users have access to administrator functions within an application.
Add Secure Apps Outposts Index (`website/docs/add-secure-apps/outposts/index.mdx`)
title: Outposts sidebar_position: 5
An outpost is a single deployment of an authentik component, essentially a service, that can be deployed anywhere that allows for a connection to the authentik API.
An outpost is required if you use any of the following types of providers with your application:
These types of providers use an outpost for increased flexibility and speed. Instead of the provider logic being implemented in authentik Core, these providers use an outpost to handle the logic, which provides improved performance.
An additional advantage of using an outpost is that outposts, like authentik itself, do not require access to the wider internet. Transactions between the application, the provider, and the outpost occur via the authentik API, and support single sign-on operations in firewalled or airgapped deployments and offline connections to remote machines that are not on the internet.
An outpost is given permissions to access the authentik API using a service account and token, both of which are auto-generated when you create a new outpost. The outpost is granted rights to only the application/provider pairs configured (and other necessary related objects such as certificates).
Any change made to the outpost's associated app or provider immediately triggers an event to update the configuration data stored on the outpost, via websockets. Websockets are used also by the outpost to send healthchecks to the authentik Core.
Create and configure an outpost
Log in to authentik as an administrator and open the authentik Admin interface.
Navigate to Applications > Outposts and then click Create.
Set the following values:
- Name: define a name for the outpost.
- Type: select the outpost type (Proxy, LDAP, Radius, RAC).
- Integration: select either Docker or Kubernetes, or optionally select
----and manually deploy the outpost. - Applications: select the applications that you want the outpost to serve.
- Advanced settings (optional): for further optional configuration settings, refer to Configuration below.
Click Create.
Upon creation, a service account and a token is generated. The service account only has permissions to read the outpost and provider configuration. This token is used by the outpost to connect to authentik.
Outpost integrations
authentik can manage the deployment, updating, and general lifecycle of an outpost. To communicate with the underlying platforms on which the outpost is deployed, authentik has several built-in integrations.
- If you've deployed authentik on Docker Compose, authentik automatically creates an integration for the local docker socket (See Docker).
- If you've deployed authentik on Kubernetes, with
kubernetesIntegrationset to true (default), authentik automatically creates an integration for the local Kubernetes Cluster (see Kubernetes).
To deploy an outpost with these integrations, select them during the creation of an outpost. A background task is started, which creates the container/deployment. The outpost deployment can be monitored from the Dashboards > System Tasks page in the Admin interface.
To deploy an outpost manually, see:
Configuration
Outposts fetch their configuration from authentik. Below are all the options you can set, and how they influence the outpost.
import Configuration from "./_config.mdx";
Prometheus Metrics
Each authentik outpost has a Prometheus metrics endpoint accessible under port :9300/metrics. This endpoint is not mapped via Docker, as the endpoint doesn't have any authentication.
For the embedded outpost, the metrics of the outpost and the metrics of the core authentik server are both returned under the same endpoint.
Add Secure Apps Providers Index (`website/docs/add-secure-apps/providers/index.mdx`)
title: Providers slug: /add-secure-apps/providers sidebar_position: 2
import DocCardList from "@theme/DocCardList";
A provider is an authentication method, a service that is used by authentik to authenticate the user for the associated application. Common providers are OpenID Connect (OIDC)/OAuth2, LDAP, SAML, a generic proxy provider, and others.
Providers are the "other half" of applications. They typically exist in a 1-to-1 relationship; each application needs a provider and every provider can be used with one application.
You can create a new provider in the Admin interface, or you can use the New Application option to create a new application and its provider at the same time.
Applications can use additional providers to augment the functionality of the main provider. For more information, see Backchannel providers.
When you create certain types of providers, you need to select specific flows to apply to users who access authentik via the provider. To learn more, refer to our default flow documentation.
You can also create a SAML provider by uploading an SP metadata XML file that contains the service provider's configuration data. SAML metadata is used to share configuration information between the Identity Provider (IdP) and the Service Provider (SP). An SP metadata XML file typically contains the SP certificate, the entity ID, the Assertion Consumer Service URL (ACS URL), and a logout URL (SingleLogoutService).
To learn more about each provider type, refer to the documentation for each provider:
Customize Blueprints Index (`website/docs/customize/blueprints/index.mdx`)
title: Blueprints sidebar_position: 3
Blueprints provide a way to template, automate, and distribute authentik configuration. Blueprints can be used to automatically configure instances, manage infrastructure-as-code without any external tools, and to distribute application configurations. Blueprints are YAML files, whose format is described further in File structure.
Blueprints are used to manage authentik's default flows and other system objects. authentik's default-authentication-flow is, under the covers, created by a blueprint.
Custom blueprints can be used to replace or modify default blueprints. You can create a new flow that's based on the default-authentication-flow but adds an additional stage or policy.
Apply blueprints
To apply a blueprint means that the content in the blueprint file is instantiated and then implemented by authentik. Blueprints can be applied in one of two ways:
- as a blueprint instance (a new instance of any authentik configuration, which you can then further customize)
- as an imported flow (to add a new flow, or to revert to the default, out-of-box flow)
To learn how to apply, create, modify, and manage blueprints, refer to Working with blueprints.
Blueprint instances
A Blueprint instance is an instantiation of a blueprint. Each instance refers to a YAML file that's either mounted into the authentik (worker) container, in an OCI registry, or the local database. (See Blueprint storage for more information.)
Multiple instances can be created from a single blueprint file. A blueprint instance populates settings in the blueprint file marked with the !Context tag from the instance's context object. To create a new instance using the Admin UI, select Blueprints > New Blueprint, give the new instance a unique name, choose the blueprint file, and supply your customizations in the Context section. Context objects must parse as JSON or YAML.
authentik watches for file modification/creation events in the blueprint directory. When a new blueprint file is created, authentik will automatically trigger a discovery. A successful discovery will automatically create and apply a new blueprint instance. When a blueprint file is modified, authentik will trigger an apply if an instance using this file exists.
authentik also scans the blueprint directory on an interval and compares each blueprint file to the copy in its database. Files that are new or modified will be discovered and applied. The default interval is 60 minutes. The interval can be changed in System Tasks > Schedules under authentik.blueprints.v1.tasks.blueprints_discovery.
:::info
To prevent authentik from creating a blueprint instance automatically from a blueprint file, add or edit the YAML metadata/labels block and disable automatic instantiation:
metadata:
labels:
blueprints.goauthentik.io/instantiate: "false":::
Imported flow
You can apply an example flow by selecting Import on either the Flows page or the Blueprints page. Then, on the Import Flow Blueprint modal, select Local path to choose one of the example blueprints bundled with authentik, or select File upload to import a downloaded or exported .yaml file from your local file system. After applying the flow, you can decide if you want to further customize the flow, or just use it as it is.
This YAML file is validated and applied directly after having been uploaded or selected from an available local path. The file is not monitored afterward or automatically applied on startup like blueprint instances.
:::info
Be aware that if you modify and save an existing default flow, what you get is a merged version of the two: the original flow (which is based on the blueprint) plus any changes you made to the flow. If you want to revert any modifications that you made to the default flow and get a fresh start with the original default flow, you have to first delete the modified flow, and then apply the flow's blueprint again.
:::
:::warning Flow imports
Flow imports are blueprint files, which may contain objects other than flows (such as policies, users, groups, etc).
You should only import files from trusted sources and review blueprints before importing them.
:::
Blueprint execution
A Blueprint is a list of entries to create, update, or delete object instances in the authentik database.
Internally, authentik is an object-oriented system of relationships which are sometimes ordered. To give a few examples:
- Flows have ordered Bindings to Stages
- Stages have ordered Bindings to Policies
- Users have Permissions
When a blueprint is applied, to ensure database consistency and prevent incomplete configurations, all entries are processed within a single atomic database transaction. This means:
- If any entry fails validation or encounters an error, the entire blueprint is rolled back
- No partial changes are committed - it's all-or-nothing
All blueprints have access to these built-in context variables:
goauthentik.io/enterprise/licensed: boolean indicating if an enterprise license is activegoauthentik.io/rbac/models: dictionary of available RBAC models
When you create or edit a blueprint instance, these context variables can be accessed using the !Context tag in the YAML file (or in the UI under Advanced settings on the Create/Edit page).
Example:
conditions:
- !Context goauthentik.io/enterprise/licensedThe order inside a Blueprint matters. To create relationships between objects, whether defined in the Blueprint or part of the existing authentik instance, authentik provides the !KeyOf and !Find operators. These operators can only resolve an entry that already exists in the database or was already applied as an earlier entry in the current Blueprint execution transaction. For example, to create a Flow, the Flow and its Stages must come first, and then the Bindings to establish the connections between the Flow and its Stages.
Blueprint storage
When you add a new blueprint instance you can define from where the .yaml file is accessed and read by authentik: as a local file, in an OCI registry, or internally in authentik's database.
As a local file
The authentik container by default looks for blueprints in /blueprints. Underneath this directory, there are a couple of default subdirectories:
/blueprints/default: default blueprints for default flows, tenants, etc/blueprints/example: example blueprints for common configurations and flows/blueprints/system: system blueprints for authentik managed Property mappings, etc
Any additional .yaml file in /blueprints will be discovered and automatically instantiated, depending on their labels.
To disable existing blueprints, an empty file can be mounted over the existing blueprint.
File-based blueprints are automatically removed when they become unavailable. However, none of the objects created by those blueprints are affected.
:::info
Please note that, by default, blueprint discovery and evaluation is not guaranteed to follow any specific order.
If you have dependencies between blueprints, you should use meta models to make sure that objects are created in the correct order.
:::
In an OCI registry
Blueprints can also be stored in remote OCI compliant registries. This includes GitHub Container Registry, Docker hub, and many other registries.
To download a blueprint via OCI, set the path to oci://ghcr.io//:<ref>. This will fetch the blueprint from an OCI package hosted on GHCR.
To fetch blueprints from a private registry with authentication, credentials can be embedded in the address.
Blueprints are re-fetched each execution, so when using changing tags, blueprints will automatically be updated.
To push a blueprint to an OCI-compatible registry, ORAS can be used with this command
oras push ghcr.io/<username>/blueprint/<blueprint name>:latest <yaml file>:application/vnd.goauthentik.blueprint.v1+yamlInternally in authentik's database
Blueprints can be stored in authentik's database, which allows blueprints to be managed via external configuration management tools like Terraform.
Modifying the contents of a blueprint will trigger its reconciliation. Blueprints are validated on submission to prevent invalid blueprints from being saved.
Customize Branding Index (`website/docs/customize/branding/index.mdx`)
title: Branding
As an authentik administrator, you can customize your instance's appearance and behavior using brands. Brands apply to a single domain, a domain wildcard, or can be set as default, in which case the brand will be applied when no other brand matches the domain.
The main settings that control your instance's appearance and behavior are the Branding settings on your brand, and the default flows that you specify.
Create or edit a brand
To create or edit a brand:
- Log in as an administrator, open the authentik Admin interface, and navigate to System > Brands.
- Click Create to add a new brand, or click the Edit icon next to an existing brand to modify it.
- Define the configurations in the following settings:
Branding settings
The brand settings define the visual identity of the brand, including:
- Branding title: Displayed in the browser tab (document title) and throughout the UI.
- Logo: Displayed in the upper-left corner.
- Favicon: Shown on the browser tab.
- Default flow background :ak-version[2025.4]: Default background image for the flow executor. See Flow configuration options to override this image on a per-flow basis.
- Custom CSS :ak-version[2025.4]: Add custom CSS to further customize the look of authentik. See Custom CSS documentation for more information.
Logo, favicon, and default flow background use the shared file picker. See File picker values.
External user settings
You can configure authentik to redirect external users to a default application after they log in (if they weren't originally redirected from a specific application). To do this:
- Open the authentik Admin interface and navigate to System > Brands.
- Click the Edit icon for the relevant brand.
- Under External user settings select a Default application.
Default flows
You can explicitly select, in your instance's Brand settings, the default flows to use for the current brand. You can optionally configure these default flows (learn more about each default flow):
- Authentication flow: the flow used to authenticate users. If left empty, the first applicable flow sorted by the slug is used.
- User switch flow: the authentication flow used when switching between users signed in on the same browser. If left empty, user switching is disabled. To reuse the default authentication flow for switching, select it here explicitly.
- Invalidation Flow: for typical use cases, select the
default-invalidation-flow(Logout) flow. This flow logs the user out of authentik when the application session ends (user logs out of the app). - Recovery flow: if set, the user can access an option to recover their login credentials.
- Unenrollment flow: if set, users are able to unenroll themselves using this flow. If no flow is set, option is not shown.
- User settings flow: if set, users are able to configure details of their profile.
- Device code flow: if set, the OAuth Device Code profile can be used, and the selected flow will be used to enter the code.
If a default flow is not set in the brand, then authentik selects any flow that:
- matches the required designation
- comes first sorted by slug
- is allowed by policiesThis means that if you want to select a default flow based on policy, you can leave the brand default empty.
Other global settings
Web Certificate
The Web Certificate option can be used to configure which certificate authentik uses when its accessed directly via HTTPS (via port 9443).
Client Certificates:ak-version[2025.4]
When using the Mutual TLS Stage and accessing authentik directly, this setting specifies which certificate authorities are trusted to issue client certificates.
Attributes
Attributes such as locale, theme settings (light/dark mode), and custom attributes can be set to a per-brand default value here. Any custom attributes can be retrieved via group_attributes().
To set the UI language for a brand, add settings.locale with a supported locale code. For example, to use English across the default brand:
settings:
locale: enTo hide the language selector on authentication flows, see Hide the locale selector.
Image optimization
When you use images and icons for a brand's logo, favicon, etc., be aware of the following optimization tips:
- Use an SVG version of the image.
- Trim excess whitespace from around the logo. You can use an SVG editor such as Inkscape, Sketch, or Adobe Illustrator.
- Adjust the viewBox: Ensure the SVG’s
viewBoxattribute tightly wraps the actual logo content. This helps in scaling the logo appropriately. - Remove fixed dimensions: delete any fixed width and height attributes from the SVG. This allows the logo to scale responsively within its container.
- Check if your SVG needs
preserveAspectRatioto retain its shape when resized. - Wordmark logos: aim for an aspect ratio of approximately 7:1 (width to height).
- Icon logos: use a 1:1 aspect ratio, ensuring the icon fills the entire viewBox and is centered.
- The SVG tool SVGOMG is useful for trimming any excess metadata that might affect how the browser rasterizes the image.
Customize Policies Index (`website/docs/customize/policies/index.mdx`)
title: Policies
tags:
- policy
- security
- access-control
sidebar_position: 1
Policies are reusable checks in authentik. They let you control whether a user can access an application, whether a stage in a flow should run, whether a source can be used, or whether data entered in a prompt stage is valid.
If you are new to policies, start here:
- Working with policies shows how to create a policy and bind it to a flow, stage, application, or source.
- Policy bindings and evaluation explains where policies are attached and how authentik combines the results.
- Types of policies in authentik groups the built-in policy types by use case.
- Expression policies covers Python-based policies for custom logic.
How policies fit together
Every policy setup has three parts:
- A policy defines a single check, such as "is the client in an allowed country?" or "did the user enter an acceptable password?"
- A binding decides where that policy applies, such as a flow, stage binding, application, or source.
- The target object combines all of its bindings using either
AnyorAllmode.
You can also bind a user or group directly in the same places where you bind policies. Those direct bindings are evaluated like simple allow or deny checks and do not require writing a policy.
Choose a policy type
Use the built-in policy types when they already match what you need. Reach for an expression policy when the built-in types are too limited.
| Policy type | Use it when | Notes |
|---|---|---|
| Event Matcher | You want to react to specific authentik events, usually for notifications or automations. | Matches event action, app, model, client IP, and AKQL queries. |
| Expression | You need custom logic that is not covered by a more specialized policy type. | Most flexible option. Runs Python and can inspect flow context, prompt data, user data, request metadata, and more. |
| GeoIP | You want to allow or deny requests based on country, ASN, or travel patterns. | Can also check recent login distance and impossible-travel scenarios. |
| Password | You want to validate password complexity, HIBP exposure, or zxcvbn strength. | Commonly attached to a prompt stage's Validation Policies. |
| Password Expiry | You want to expire passwords after a fixed number of days. | Can either deny login or mark the password unusable so the user must update it. |
| Password Uniqueness | You want to prevent password reuse. | Enterprise feature. |
| Reputation | You want to react to failed logins or suspicious sign-in activity. | Useful for showing CAPTCHA or another challenge only to low-reputation requests. |
Deprecated policy types
Have I Been Pwned policy
The standalone Have I Been Pwned policy is deprecated. Use the Password Policy instead, which includes the same HIBP check.
Developer Docs Hackathon Index (`website/docs/developer-docs/hackathon/index.mdx`)
title: 2023 hackathon archive
The first authentik community hackathon ran online from July 26 through July 30, 2023. Registration and event activities are closed; this page preserves a summary of the event.
About the event
Community members worked on authentik code, documentation, and other project improvements. Moderators supported participants across US and European hours, and participants coordinated work through GitHub and Discord.
The event included a $5,000 prize pool, authentik merchandise, and community recognition.
Schedule
- Wednesday, July 26: Kickoff, topic selection, team formation, and development-environment setup.
- Thursday, July 27: First hack day and participant check-in.
- Friday, July 28: Second hack day and participant check-in.
- Saturday, July 29: Project wrap-up and initial demonstrations.
- Sunday, July 30: Final demonstrations, voting, and awards.
Event workspace
Participants developed their contributions in the authentik GitHub repository and coordinated in the community Discord server. The event used GitHub issues to propose projects and indicate community interest.
Prize distributions were subject to applicable local, state, national, and international laws.
Developer Docs Setup Index (`website/docs/developer-docs/setup/index.mdx`)
title: Development environment
import DocCardList from "@theme/DocCardList";
Pick the setup that fits your workflow: full stack, frontend-only, or just the docs and grab some debugging tips along the way.
Endpoint Devices Authentik Agent Index (`website/docs/endpoint-devices/authentik-agent/index.mdx`)
title: authentik Agent sidebar_label: "authentik Agent" sidebar_position: 1
import DocCardList from "@theme/DocCardList";
What is the authentik Agent?
The authentik Agent is a service that can be installed on Linux, macOS, and Windows devices. It provides the following capabilities:
- Device compliance by reporting information about endpoint devices to authentik
- Local device login with authentik credentials
- Connecting via SSH to endpoint devices with authentik credentials
- Authenticating to CLI applications such as kubectl and AWS with authentik credentials
authentik Agent components
The authentik Agent consists of several components:
| Platform | Component | Description | Dependencies |
|---|---|---|---|
| Linux, macOS, Windows | authentik-cli |
Provides CLI commands for interacting with authentik-agent. |
authentik-agent |
| Linux, macOS, Windows | authentik-agent |
Authentication within a users' context, for CLI tools. | authentik-sysd |
| Linux, macOS, Windows | authentik-sysd |
Responsible for handling device-level authentication and compliance checks. | None |
| Linux only | libpam-authentik |
PAM Module for token-based and interactive authentication via authentik. Used for SSH authentication and local device login. | authentik-sysd |
| Linux only | libnss-authentik |
NSS Module that makes Linux aware of authentik users. All authentik users are visible to Linux but cannot log in unless configured through device access groups. Provides a consistent uid and gid for users on all endpoint devices. |
authentik-sysd |
| Windows only | Windows Credential Provider (WCP) |
Enables logging in to Windows devices using authentik credentials. | authentik-sysd |
Technical information
All authentik Agent components communicate via gRPC and Unix domain sockets/Windows named pipes.
Linux: /var/run/authentik/sys.sock and /var/run/authentik/sys-ctrl.sock
macOS: /var/run/authentik-sysd.sock and /var/run/authentik-sysd-ctrl.sock
Windows: \\.\pipe\authentik\sysd and \\.\pipe\authentik\sysd-ctrl
sys.sock/*sysd.sockfor general communication*-ctrl.sockfor domain join
Important considerations
Sentry reporting is currently enabled by default and cannot be disabled. This will be configurable in a future release.
Report issues
Please report issues and bugs via the authentik Platform GitHub repository.
More information
For more information, refer to each of the topics below:
Endpoint Devices Device Compliance Index (`website/docs/endpoint-devices/device-compliance/index.mdx`)
title: Device Compliance sidebar_label: "Device compliance" authentik_version: "2025.12.0" sidebar_position: 3
import DocCardList from "@theme/DocCardList";
Device compliance lets authentik verify that a user's device meets security and configuration criteria, such as operating system version, disk encryption, antivirus status etc, before allowing access to resources.
Device compliance is currently in very early preview. Device compliance policies are currently inaccessible and therefore have to be emulated with existing policies.
For more information, pick a topic below:
Install Config First Steps Index (`website/docs/install-config/first-steps/index.mdx`)
title: First steps sidebar_position: 3
import "./styles.css";
After you have installed and started authentik, you are now ready to add your first application and provider, add some users, and get started with using authentik as your Identity provider.
architecture-beta
group first
service install(mdi:application-cog-outline)[Install authentik] in first
service acl(mdi:account-key-outline)[Access authentik] in first
service apps(mdi:plus-box-multiple-outline)[Add an app and provider] in first
service users(mdi:account-multiple-plus)[Create a new user] in first
service further(mdi:cog-clockwise)[Further customization] in first
install:R --> L:acl
acl:R --> L:apps
apps:R --> L:users
users:R --> L:furtherWhere are we now, and what's next?
The following tutorial assumes that you have already:
Installed authentik on either Docker Compose, Kubernetes, or AWS CloudFormation and confirmed that the server, worker, and the PostgreSQL database are started and running.
Opened authentik in your browser to the
initial-setupflow and added credentials for a default Admin account. (Docker, Kubernetes), or AWS CloudFormation.
:::info Initial setup in browser
You will get a Not Found error if the initial setup URL doesn't include the forward slash / at the very end of the URL. Also verify that the authentik server, worker, and PostgreSQL database are running and healthy. Review additional tips in our troubleshooting docs.
:::
Other optional pre-installation configurations that you might have already completed include:
- Configured your global email settings.
- Configured your PostgreSQL settings (read-replica, connections, etc.).
- Configured a reverse proxy.
- Configured your media storage settings or optionally S3 file storage.
- Added additional custom configurations environment variables.
- Verified your configuration settings.
Install your first application and provider
Now that you have your authentik instance installed and configured with the required settings, you can add your first application and provider. After that, we'll walk through how to add your first user.
:::tip Security Best Practice
In a production environment, best practice is to first create a group, then create the user(s), and then add the application. Then you can configure the application to have a binding to a specific group or user. The binding controls access to the application and whether it is displayed on a user's Application Dashboard page.
:::
authentik supports integration with any application; refer to our Integrations documentation to view integrations guides for over 180 of the most common ones.
In this guide we'll be setting up Grafana as an example application.
Why Grafana?We'll use Grafana as an example application in this guide as it is very common and straightforward to set up.
For more configuration options and full details about integrating with Grafana, refer to our full integration guide. The following steps require that you have a Grafana instance running in Docker, and that you can access the authentik Admin interface.
1. Log in to authentik as an administrator and open the authentik Admin interface.
A. In the Admin interface, navigate to Applications > Applications and click New Application to create an application and provider pair.
:::tip About application and provider pairs
Every application that you add to authentik requires a provider, which is used to configure the specific protocol between the application and authentik, for example OAuth2/OIDC, SAML, LDAP, or others.
:::
B. Provide the details for the application (Grafana) and provider (OAuth2/OIDC).
- Configure the Application:
- Name: provide a descriptive name (such as Grafana).
- Group: select an optional group for the application; groups are used to visually separate applications. For example, you can choose to group applications that you use for coding from those you use for internal communication.
- Policy engine mode: select Any for this tutorial. The mode determines how authentik combines binding results.
- TIP: in authentik,
policies are used in authentik to fine-tune
access to applications, flows, stages, and many other authentik components. You do not
need to use a policy for every application. The Any policy engine mode grants access
when at least one binding passes, or when no bindings are configured. The All mode
requires every binding on the application to pass.
- TIP: in authentik,
- UI Settings: optional UI settings that are displayed about the application, including the launch URL, and three settings to display extra information about the application on the Application Dashboard page: an optional icon, the publisher of the application, and a brief description.
- Name: provide a descriptive name (such as Grafana).
- Choose a Provider Type: select OAuth2/OpenID Connect as the provider type.
- Configure the Provider:
- Name: Provide a name (or accept the auto-provided name).
- Authorization flow: Select the default
implicitauthorization flow to use for this provider. - Protocol settings: provide the following required configurations:
- Note the Client ID, Client Secret, and Slug values because they will be required later when you configure Grafana to use authentik.
- Add a Redirect URI of type
StrictAuthorizationashttps://grafana.company/login/generic_oauth.- TIP: The Redirect URI is where a user is directed to,
as soon as authentik's authorization flow is successfully completed.
- TIP: The Redirect URI is where a user is directed to,
- Grant Types (required): Select at least one grant type that the provider can use.
- Logout URI: set to
https://grafana.company/logout. - Logout Method: set to
Front-channel.- TIP: With OAuth2, front-channel logout is considered the
default because most applications (including Grafana) do not support back-channel logout.
- TIP: With OAuth2, front-channel logout is considered the
- Signing Key: select any available signing key.
- TIP: authentik generates a key that you can use, called
theauthentik Self-signed Certificate, if you do not have a specific signing key for an
application.
- TIP: authentik generates a key that you can use, called
- Configure Bindings (optional): for this tutorial, skip this step because you do not yet have a user. Later, after you create your first user, you can create a binding to manage access to the application and its display on a user's Application Dashboard page.
- TIP: By creating a binding between an application and a
specific user, you are ensuring that the application is accessible only to that user and any
other users or groups for whom you created a binding. Learn more about how bindings are used
in authentik in our Bindings overview.
For any fields not mentioned above, you can leave the default value.
- TIP: By creating a binding between an application and a
C. Click Create Application to save the new application and provider.
2. Configure Grafana to use authentik as its IdP
For some applications, you log in to the application and configure settings there; with Grafana you simply edit your Grafana Docker Compose file. Here you add basic configuration settings as well as the Client ID, Client Secret, and the Slug values that you obtained when you configured the application and provider in authentik in Step 1 above.
A. In the Grafana Docker Compose file, set the following environment variables:
:::tip Tips
These values are for a Grafana instance running in Docker; for standalone or Helm Chart instances refer to our Grafana integration guide.
Note that authentik.company is a placeholder that we use in our example settings; replace this with the domain that authentik is running on in your environment.
:::
environment:
GF_AUTH_GENERIC_OAUTH_ENABLED: "true"
GF_AUTH_GENERIC_OAUTH_NAME: "authentik"
GF_AUTH_GENERIC_OAUTH_CLIENT_ID: "<Client ID from above>"
GF_AUTH_GENERIC_OAUTH_CLIENT_SECRET: "<Client Secret from above>"
GF_AUTH_GENERIC_OAUTH_SCOPES: "openid profile email"
GF_AUTH_GENERIC_OAUTH_AUTH_URL: "https://authentik.company/application/o/authorize/"
GF_AUTH_GENERIC_OAUTH_TOKEN_URL: "https://authentik.company/application/o/token/"
GF_AUTH_GENERIC_OAUTH_API_URL: "https://authentik.company/application/o/userinfo/"
GF_AUTH_SIGNOUT_REDIRECT_URL: "https://authentik.company/application/o/<application_slug>/end-session/"
# Optionally enable auto-login (bypasses Grafana login screen)
GF_AUTH_OAUTH_AUTO_LOGIN: "true"
# Optionally map user groups to Grafana roles
GF_AUTH_GENERIC_OAUTH_ROLE_ATTRIBUTE_PATH: "contains(groups[*], 'Grafana Admins') && 'Admin' || contains(groups[*], 'Grafana Editors') && 'Editor' || 'Viewer'"
# Required if Grafana is running behind a reverse proxy
GF_SERVER_ROOT_URL: "https://grafana.company"B. Save your Grafana Docker Compose file, and then launch the stack and access Grafana via your browser at the configured URL.
C. To confirm that authentik is properly configured with the new application, log out of Grafana and then log back in using the Sign in with authentik button. You should be redirected to authentik to provide credentials.
Add your first user
Now that you can access the authentik Admin interface, and you have added an application and provider, let's add a new user.
1. Log in to authentik as an administrator and open the authentik Admin interface.
**A.** Navigate to **Directory > Users**, click **New User**, and then select **Internal User**.
**B.** Fill in all **_required_** fields:
- **Username**: This value must be unique across all users.
- **Display Name** (_optional_): The display name of the user.
- **Email** (_optional_): The email address of the user. Email addresses are used in [email stages](../../add-secure-apps/flows-stages/stages/email/index.mdx), as an alternative method to log in, by services to request an email address, and if configured, to receive [notifications](../../sys-mgmt/events/notifications.mdx).
- **Active** (_optional_): Define if the newly created user account is active. Selected by default.
- **Path**: The path where the user will be created. By default the new user is created in the `users` folder, but you can change that later by editing the user.
- TIP: Paths are directories that are used to organize your
users (for example HR vs Sales, etc.). Paths do not impact access; they are purely
organizational. Note that the top-level **users** folder displays all users in that folder
and all sub-folders.
- **Attributes** (_optional_): [Custom attributes](../../users-sources/user/user_ref.mdx) for the user, in YAML or JSON format. These attributes can be used to enforce additional prompts on authentication stages or define conditions to enforce specific policies if the current implementation does not fit your use case. The value is an empty dictionary by default.C. Click Create.
For more information refer to our documentation on managing users.
2. Verify that the new user was created
- Look for the new user in the list on the Directory > Users page.
What's next?
Now that you have added your first application, and a new user, here are some typical next steps:
- Assign your new user to appropriate groups and roles.
- Restrict access to an application. See more below about using bindings to restrict access.
- Learn more about Role Based Access Control (RBAC) in authentik.
- Configure federated or external sources (an existing source of user credentials and other user data).
- Set up MFA
- Define property mappings.
- Create a custom flow.
- Get started with authentik Enterprise
- Create a policy to control access, force MFA use, etc.
Things to know and troubleshooting tips
Review the following information to learn more about the basics of setting up authentik and for troubleshooting tips.
Modify the Docker Compose file
Especially when you are just starting out with authentik, we recommend that you use the default compose.yml file that comes with the download, instead of trying to write the file from scratch. After you have successfully installed, configured, and accessed authentik, you can edit the file to do more advanced configurations, as documented in the Configuration section.
Reverse proxy
Typically authentik is set up with a reverse proxy in front of it. If you already have a reverse proxy that you are using to handle your incoming network traffic, you can simply use that same reverse proxy for authentik, by adding a few configuration values. For more details see the Reverse proxy guide.
The `latest` tag is deprecated
The :latest tag has been deprecated and will never be updated from the 2025.2 release.
Instead, use a specific version tag for authentik instances' container images, such as :2025.12.
Use bindings to allow or restrict access to applications {#using-bindings-to-allow-or-restrict-access-to-applications}
If you do not define any bindings, all users have access to the application. To control access, you can create a binding. For more information, see policy-driven authorization and hiding an application.
Upgrades
When you are ready to upgrade to the latest version, be sure to read our Upgrade documentation and refer to the Release Notes for the specific version.
Sys Mgmt Events Index (`website/docs/sys-mgmt/events/index.mdx`)
title: Events
Events are authentik's built-in logging system. Every event is logged, whether it is initiated by a user or by authentik.
Certain information is stripped from events to ensure that no passwords or other credentials are saved in the log.
About notifications
Events can be used to define notification rules, with specified transport options of either local (shown in the authentik UI), email, or webhook.
About logging
Event logging in authentik provides several layers of transparency about user and system actions, from a quick view on the Overview dashboard, to a full, searchable list of all events, with a volume graph to highlight any spikes, in the Admin interface under Events > Logs.
Refer to our Logging documentation for more information.
Event retention and forwarding
The event retention setting is configured in the System > Settings area of the Admin interface, with the default being set to 365 days.
If you want to forward these events to another application, forward the log output of all authentik containers. Every event creation is logged with the log level "info". For this configuration, it is also recommended to set the internal retention time period to a short time frame (for example, days=1).
If you want to forward authentik events to another system, see Log forwarding.
Event map :ak-enterprise {#event-map}
The events overview renders login and audit event locations on a built-in map. By default authentik uses a bundled "hexworld" basemap: land drawn as a hexagonal grid at three zoom bands, with country, region, and locality labels layered on top. The archive ships as part of the web bundle, so the map draws with no tile server, no external service, and no online request, and it works in air-gapped deployments.
Event locations come from GeoIP and are city-accurate at best. The hex bands are sized to match: about 1000 km at world view, 400 km mid-range, and 130 km at closest zoom. Events raise their hex cell into a column — the fuller a cell, the taller the column — on a tilted globe. When a cell contains more than one kind of event, the column splits into pie wedges colored by kind: logins (green), failed logins (red), logouts (blue), application authorizations (purple), and everything else (gray). Clicking a column filters the event list below to that cell's events. Custom basemaps configured under System > Brands show the same event columns over the configured tiles.
Label data is derived from OpenStreetMap (© OpenStreetMap contributors, ODbL). Land shapes are from Natural Earth (public domain).
Using a conventional basemap instead
To replace the hexworld default with a conventional vector basemap, set a tile URL template on the brand under System > Brands — the Map tiles field takes either a pmtiles:// archive URL or an XYZ endpoint like /tiles/{z}/{x}/{y}.mvt. Any non-empty value overrides the bundled default; leave it blank to keep hexworld.
Users Sources Access Control Index (`website/docs/users-sources/access-control/index.mdx`)
title: Access control sidebar_position: 4
import DocCardList from "@theme/DocCardList";
To comply with important regulations such as PCI-DSS, HIPAA, SOC 2, and GDPR, it's necessary to have the ability to control which users have access to specific areas of the system, what permissions they have globally and on certain objects, and a way to monitor events related to user activity.
In authentik, we provide role-based access control (RBAC), an industry standard for managing access control. By carefully designing roles with appropriate permissions, and then assigning those roles to groups, RBAC provides a fine-tuned approach to controlling user access.
RBAC is a way of ensuring the well-known principle of least privilege whereby "every module (such as a process, a user, or a program, depending on the subject) must be able to access only the information and resources that are necessary for its legitimate purpose."
To learn more about access control with authentik, refer to these topics:
Users Sources Groups Index (`website/docs/users-sources/groups/index.mdx`)
title: Groups sidebar_position: 2
For information about creating and editing groups refer to Manage groups.
Hierarchy
Groups can be children of other groups. Members of children groups are effective members of the parent group.
When you bind a group to an application or flow, any members of any child group of the selected group will have access.
Attributes
Attributes of groups are recursively merged, for all groups the user is a member of. For more information, see Group properties and attributes.
Users Sources Roles Index (`website/docs/users-sources/roles/index.mdx`)
title: Roles sidebar_position: 3
import DocCardList from "@theme/DocCardList";
Roles are a way to simplify the assignment of permissions. Roles are also the backbone of role-based access control (RBAC), an industry standard for managing access control. In authentik, RBAC is how you manage access to system components and specific objects such as flows, stages, users, etc.
Think of roles as a collection of permissions. A role, along with its "bucket" of assigned permissions, can then be assigned to a user, or it can be assigned to a group (which means that every user who is a part of that group will inherit all of the permissions in that role's "bucket").
Roles are also inherited through group hierarchy. When a role is assigned to a parent group, all child groups automatically inherit that role. This means users in any descendant group will have the permissions from roles assigned to any of their ancestor groups.
For example, let's take a look at the following scenario:
You need to add 5 new users, all new hires, to authentik, your identity management system. These users will be the first team members on the brand new Security team, so they will need some high-level permissions, with object permissions to create and remove other users, revoke permissions, and send recovery emails. They will also need global permissions to control access to flows and stages.
The easiest workflow for setting up these new users involves creating a role specifically for their type of work, and then assigning that role to a group to which all of the users belong.
View roles for users and groups
You can view the roles assigned to a user or group through their detail pages in the Admin interface.
User roles
To view roles for a user:
- Navigate to Directory > Users and click on a user's name.
- Click the Roles tab.
- The tab has two sub-tabs:
- Assigned Roles: Shows roles directly assigned to this user.
- All Roles: Shows all roles the user has, including roles inherited from groups they belong to. Inherited roles are marked with an "Inherited" label.
Group roles
To view roles for a group:
- Navigate to Directory > Groups and click on a group's name.
- Click the Roles tab.
- The tab has two sub-tabs:
- Assigned Roles: Shows roles directly assigned to this group.
- All Roles: Shows all roles the group has, including roles inherited from parent groups. Inherited roles are marked with an "Inherited" label.
To learn more about working with roles in authentik, refer to the following topics:
Users Sources Sources Index (`website/docs/users-sources/sources/index.mdx`)
title: Sources sidebar_position: 5 sidebar_label: "Federated and Social Sources"
Sources allow you to connect authentik to an external user directory. Sources can also be used with social login providers such as Facebook, X, or GitHub.
Find your source
Sources are in the following general categories:
- Protocols (Kerberos, LDAP, OAuth, SAML, and SCIM)
- Property mappings or how to import data from a source
- Directory synchronization (Active Directory, FreeIPA)
- Social logins (Apple, Discord, Twitch, Twitter, and many others)
For instructions to add a specific source, refer to the documentation links in the left navigation pane.
Several source types also expose an Icon field that uses the shared file picker. See File picker values.
Add sources to default login page
To show sources on the default login screen, add them to the flow. The process below assumes that you have not created or renamed the default stages and flows.
- Log in to authentik as an administrator and open the authentik Admin interface.
- Navigate to Flows and Stages > Flows.
- Click the default-authentication-flow.
- Click the Stage Bindings tab.
- Click Edit Stage on the default-authentication-identification stage.
- Under Source settings, add sources to Selected Sources to have them displayed on the authentik login page.
Bind a policy to a source
You can bind a policy to a source to control whether or not the users from the source can access an application.
For instructions, refer to Bind a policy to a source.
Users Sources User Index (`website/docs/users-sources/user/index.mdx`)
title: About users sidebar_position: 1 sidebar_label: "Users"
import DocCardList from "@theme/DocCardList";
In authentik you can create and manage users with fine-tuned access control, session and event details, group membership, role assignment, super-user rights, impersonation, and password management and recovery.
To learn more about Enterprise licenses with internal and external users, refer to Manage Enterprise licensing.
To learn more about working with users in authentik, refer to the following topics:
Add Secure Apps Flows Stages Flow Index (`website/docs/add-secure-apps/flows-stages/flow/index.mdx`)
title: Flows sidebar_label: "Flows" sidebar_position: 1
Flows are a major component in authentik. In conjunction with stages and policies, flows are at the heart of our system of building blocks, used to define and execute the workflows of authentication, authorization, enrollment, and user settings.
There are over a dozen default, out-of-the-box flows available in authentik. Users can decide if they already have everything they need with the default flows or if they want to create their own customized flow, using the Admin interface, Terraform, or via the API.
A flow is a method of describing a sequence of stages. A stage represents a single verification or logic step. By connecting a series of stages within a flow (and optionally attaching policies as needed) you can build a highly flexible process for authenticating users, enrolling them, and more.
For example a standard login flow would consist of the following stages:
- Identification stage: user identifies themselves via a username or email address
- Password stage: the user's password is checked against the hash in the database
- Login stage: this stage attaches a currently pending user to the current session
When these stages are successfully completed, authentik logs in the user.
By default, policies bound to stage bindings are evaluated dynamically, right before the stage is presented to the user. This flexibility allows the login process to continue, change, or stop, based on the success or failure of each policy.
You can change this behavior by enabling the Evaluate when flow is planned option on the stage binding. When this option is enabled, authentik uses the Flow Planner to evaluate the stage binding's policies when the flow starts, and includes the stage in the flow plan only if those policies pass.
Policies and permissions
Flows can have policies assigned to them. These policies determine if the current user is allowed to see and use this flow.
Keep in mind that in certain circumstances, policies cannot match against users and groups as there is no authenticated user yet.
Import or export a flow
Flows can be imported and exported (as blueprints) to share with other people, the community, and for troubleshooting.
Flows can be imported to add new functionality to existing flows, or to add a new custom flow.
You can download our Example flows and then import them into your authentik instance, or create a new flow.
Starting with authentik 2022.8, flows are exported as YAML, but legacy JSON-based flows can still be imported.
:::warning Flow imports
Flow imports are blueprint files, which may contain objects other than flows (such as policies, users, groups, etc).
You should only import files from trusted sources and review blueprints before importing them.
:::
Create a flow
To create a flow, follow these steps:
- Log in to authentik as an administrator and open the Admin interface.
- In the Admin interface, navigate to Flows and Stages > Flows.
- Click New Flow, define the flow using the configuration settings described below, and then click Create Flow.
After creating the flow, you can then bind specific stages to the flow and bind policies to the flow to further customize the user's log in and authentication process.
To determine which flow should be used, authentik will first check which default authentication flow is configured in the active Brand. If no default is configured there, the policies in all flows with the matching designation are checked, and the first flow with matching policies sorted by slug will be used.
Flow configuration options
When creating or editing a flow in the UI of the Admin interface, you can set the following configuration options.
Name: Enter a descriptive name. This is the name that will appear on the list of flows in the Admin interface.
Title: This is the title that will appear on the flow as the end-user logs in and encounters the flow.
Slug: The slug will be used, and appear, in the URL when the flow is in use.
Designation: Flows are designated for a single purpose. This designation changes when a flow is used. The following designations are available:
import Defaultflowlist from "../flow/flow_list/_defaultflowlist.mdx";
Authentication: Using this option, you can configure whether the flow requires initial authentication or not, whether the user must be a superuser, if the flow can only be started after being redirected by a Redirect stage, or if the flow requires an outpost.
Behavior settings:
Compatibility mode: Toggle this option on to increase compatibility with password managers and mobile devices. Password managers like 1Password, for example, don't need this setting to be enabled when accessing the flow from a desktop browser. However, accessing the flow from a mobile device might necessitate this setting to be enabled.
The technical reason for this setting's existence is the JavaScript libraries we're using for the default flow interface. These interfaces are implemented using Lit, which is a modern web development library. It uses a web standard called "Shadow DOMs", which makes encapsulating styles simpler. Due to differences in Browser APIs, many password managers are not compatible with this technology.
When the compatibility mode is enabled, authentik uses a polyfill which emulates the Shadow DOM APIs without actually using the feature, and instead a traditional DOM is rendered. This increases support for password managers, especially on mobile devices.
Denied action: Configure what happens when access to a flow is denied by a policy. By default, authentik will redirect to a
?nextparameter if set, and otherwise show an error message.MESSAGE_CONTINUE: Show a message if no?nextparameter is set, otherwise redirect.MESSAGE: Always show error message.CONTINUE: Always redirect, either to?nextif set, otherwise to the default interface.
Policy engine mode: Configure the flow to succeed in any policy passes, or only if all policies pass.
Appearance settings:
Layout: select how the UI displays the flow when it is executed; with stacked elements, content left or right, and sidebar left or right.
Background: optionally, select a background image for the UI presentation of the flow. This overrides any default background image configured in the Branding settings. See File picker values.
Edit or delete a flow
To edit a flow, navigate to Flows and Stages > Flows in the Admin interface, and then click Edit for the flow that you want to modify.
To delete a flow, navigate to Flows and Stages > Flows in the Admin interface, select the checkbox in front of the flow that you want to delete, and then click Delete. You can retrieve and re-apply that flow by following the steps above to create a new flow.
Add Secure Apps Flows Stages Stages Index (`website/docs/add-secure-apps/flows-stages/stages/index.mdx`)
title: Stages sidebar_position: 1
Stages are one of the fundamental building blocks in authentik, along with flows and policies.
A stage represents a single verification or logic step within a flow. You can bind one or more stages to a flow to create a customized, flexible login and authentication process.
In the following diagram of the default-authentication-flow, you see multiple stages, or steps, in the authentication process for a user. Policies are bound to some stages; this provides for dynamic application of a specific stage if the policy criteria is met.
graph TD
flow_pre[["Pre-flow policies"]]
flow_pre --Binding 10--> flow_policy_0{{"Policy (Event Matcher Policy)
default-match-update"}}
flow_policy_0 --Policy denied--> done[["End of the flow"]]
flow_policy_0 --> flow_start[["Flow
Welcome to authentik!"]]
stage_0_policy_0 --Policy passed--> stage_0(["Stage (Identification Stage)
default-authentication-identification"])
stage_1_policy_0 --Policy passed--> stage_1(["Stage (Password Stage)
default-authentication-password"])
--> stage_2(["Stage (Authenticator Validation Stage)
default-authentication-mfa-validation"])
--> stage_3(["Stage (User Login Stage)
default-authentication-login"])
flow_start --> stage_0_policy_0{{"Policy (Event Matcher Policy)
default-match-configuration-error"}}
stage_0 --> stage_1_policy_0{{"Policy (Expression Policy)
default-authentication-flow-password-stage"}}
stage_0_policy_0 --Policy denied--> stage_1(["Stage (Password Stage)
default-authentication-password"])
stage_1_policy_0 --Policy denied--> stage_2(["Stage (Authenticator Validation Stage)
default-authentication-mfa-validation"])
stage_3 --> done[["End of the flow"]]Create a stage
To create a stage, follow these steps:
- Log in as an admin to authentik, and go to the Admin interface.
- In the Admin interface, navigate to Flows and Stages > Stages.
- Click New Stage, select the stage type, define the stage using the configuration settings, and then click Create Stage.
After creating the stage, you can use bindings to determine whether the stage runs in a flow.
Stage bindings
A stage binding connects a stage to a flow. The binding adds that stage as a step in the flow.
You can use bindings to determine which stages are presented to a user or group.
For an overview of binding types and behavior, see Bindings in authentik.
:::info
Some stages and flows do not allow user or group bindings. In some authentication or enrollment scenarios, the flow plan does not yet know the current user or group.
:::
Bind a stage to a flow
To bind a stage to a flow, follow these steps:
- Log in as an admin to authentik, and go to the Admin interface.
- In the Admin interface, navigate to Flows and Stages > Flows.
- In the list of flows, click the name of the flow to which you want to bind one or more stages.
- On the Flow page, click the Stage Bindings tab at the top.
- Click Create or bind....
- Select Existing Stage to bind an existing stage to the flow, or select Bind New Stage to create a new stage and bind it to the flow.
Control access to a stage
There are several ways to control access to a specific stage of a flow:
- Bind a policy to a stage binding. See Bind a policy to a stage binding.
- Bind a user or group to the stage binding. See Bind users and groups to a flow's stage binding.
Bind users and groups to a flow's stage binding
You can use bindings to determine whether a stage is presented to a single user or to members of a group. Bind the user or group to the stage binding within a specific flow. For example, if a flow contains an MFA stage that should run only for certain users, bind the appropriate group or user to that stage binding.
To bind a user or a group to a stage binding for a specific flow, follow these steps:
- Log in as an admin to authentik, and go to the Admin interface.
- In the Admin interface, navigate to Flows and Stages > Flows.
- In the list of flows, click the name of the flow to which you want to bind one or more stages.
- On that Flow's detail page, click the Stage Bindings tab at the top.
- In the list, locate the stage binding to which you want to bind a user or group, and then click the caret (>) to expand the stage binding details.
- In the expanded area, click Create or bind....
- Under Bind Existing, select either Bind a user or Bind a group.
- In the drop-down list, select the group or user.
- Optionally, configure additional settings for the binding, and then click Create to create the binding and close the box.
Learn more about the different types of bindings in authentik and working with them.
Add Secure Apps Providers Entra Index (`website/docs/add-secure-apps/providers/entra/index.mdx`)
title: Microsoft Entra ID provider authentik_enterprise: true sidebar_position: 5 sidebar_label: "Microsoft Entra ID Provider"
The Entra ID provider allows you to integrate with your Entra ID tenant. It supports syncing users and groups from authentik to Entra ID, allowing authentik to act as a source of truth for all users and groups.
- For instructions on configuring your Entra ID tenant in prepation for creating an Entra ID provider, refer to Configure Entra ID.
- For instructions on creating an Entra ID provider, refer to Create an Entra ID provider.
If you also want to authenticate to Entra ID using authentik credentials, refer to our Microsoft 365 SAML or Microsoft 365 WS-Federation integrations guides.
Discovery
Upon creating the Entra ID provider, it will run a discovery task to query your Entra ID tenant for all users and groups, and attempt to match them with their respective counterparts in authentik.
Users are matched on their email address. Groups are matched based on their names.
This discovery also takes into consideration any User filtering options configured in the provider, such as only linking to authentik users in a specific group or excluding service accounts. This discovery process occurs each time a full sync is initiated.
Synchronization
There are two types of synchronization: direct sync and full sync.
Direct sync
A direct sync occurs when a user or group is created, updated or deleted in authentik, or when a user is added to or removed from a group. When any of these events occur, the direct sync automatically syncs those changes to Entra ID.
Full sync
A full sync occurs when the provider is initially created and when it is saved. During a full sync, all users and groups that match the User filtering settings are processed and created or updated in Entra ID. After the initial sync, authentik automatically performs a full sync every four hours by default to maintain consistency between users and groups.
During the full sync, if a user or group exists in both authentik and Entra ID, authentik will automatically link them.
Additionally, any users or groups present in authentik but absent in Entra ID will be created and linked.
Deletion and offboarding
The provider's User deletion action and Group deletion action control what happens to the linked Entra ID object when you delete its counterpart in authentik. Both settings default to Delete. Deletion is processed by a background sync task and requires the provider to remain assigned to an application. Dry-run mode prevents changes to the remote directory.
| Action | When an authentik user is deleted | When an authentik group is deleted |
|---|---|---|
Delete (delete, default) |
Deletes the linked Entra ID user account. | Deletes the linked Entra ID group. |
Suspend (suspend) |
Keeps the Entra ID account and disables sign-in by setting Microsoft Graph's accountEnabled to false. |
Unsupported. Treated as Do Nothing, leaving the remote group unchanged. |
Do Nothing (do_nothing) |
Leaves the Entra ID account unchanged, including its enabled or suspended status. | Leaves the Entra ID group unchanged. |
All three actions remove authentik's connection record for the deleted user or group. Suspend retains the remote user account; it does not retain the deleted authentik user. Do Nothing does not revoke access to the remote account.
In the Admin interface, User deletion action offers Delete, Suspend, and Do Nothing. Suspension applies only to users, so Group deletion action offers Delete and Do Nothing.
Deactivate a user without deleting the account
Marking an authentik user inactive is an update, so it does not use User deletion action. With the default user property mapping, authentik sets account_enabled to False, which becomes accountEnabled: false in Microsoft Graph. The authentik user and its connection record remain, and reactivating the user allows the default mapping to enable the remote account again.
This requires the user to remain included in synchronization. Custom property mappings can change whether active status is synchronized.
Offboard users and groups
- To retain a user's accounts while disabling sign-in, mark the authentik user inactive and verify that synchronization has disabled the Entra ID account before removing the user from synchronization filters.
- To delete an authentik user while retaining the remote account, select Suspend for User deletion action before deleting the user. Use Do Nothing only if you intend to manage the remote account's access separately.
- To delete the remote user or group as well, use Delete. Complete any required data retention or ownership transfers in Entra ID before deleting the authentik object.
- After offboarding, check the provider's sync tasks for errors and verify the account or group state in Entra ID.
Removing a user from the provider's filtering group, changing User filtering to exclude the user, or skipping a user with SkipObject does not itself delete or suspend the remote account. These changes exclude the user from provisioning updates. Removing group membership can also remove that membership in Entra ID, but it does not disable the account.
Do not rely on filtering alone to revoke access. If you later delete a previously linked authentik user, its retained connection record still allows the configured deletion action to run.
Error handling
Property mappings are evaluated in name order. If a property mapping fails to evaluate, authentik stops the synchronization and does not evaluate the remaining mappings.
To handle network interruptions, authentik detects transient request failures and retries sync tasks.
Property mapping
There are several considerations regarding how authentik data is mapped to Entra ID user and group data.
Users
For users, authentik only saves the full display name, not separate first and family names.
By default, authentik maps a user's email address, name, and whether the user is active.
Refer to the Entra ID documentation for further details on which attributes can be mapped: Microsoft Graph - Create User
Groups
By default, authentik only maps a group's name, mail_enabled status, security_enabled status and mail_nickname (equivalent to name).
Refer to the Entra ID documentation for further details on these attributes and which attributes can be mapped: Microsoft Graph - Create Group
Skip objects during synchronization
To exclude specific users or groups from Entra ID synchronization, you can create a property mapping that raises the SkipObject exception. When this exception is raised during the evaluation of a property mapping, the object is skipped and the sync continues with the next object.
For more information, refer to Skip objects during synchronization.
Add Secure Apps Providers Gws Index (`website/docs/add-secure-apps/providers/gws/index.mdx`)
title: Google Workspace provider authentik_enterprise: true sidebar_position: 3 sidebar_label: "Google Workspace Provider"
The Google Workspace provider allows you to integrate with your Google Workspace organization. It supports syncing users and groups from authentik to Google Workspace, allowing authentik to act as a source of truth for all users and groups.
- For instructions on configuring your Google Workspace organization in prepation for creating a Google Workspace provider, refer to the Configure Google Workspace documentation.
- For instructions on creating a Google Workspace provider, refer to the Create a Google Workspace provider documentation.
Discovery
Upon creating the Google Workspace provider, it will run a discovery task to query your google workspace for all users and groups, and attempt to match them with their respective counterparts in authentik.
Users are matched on their email address. Groups are matched based on their names.
This discovery also takes into consideration any User filtering options configured in the provider, such as only linking to authentik users in a specific group or excluding service accounts. This discovery process occurs each time a full sync is initiated.
Synchronization
There are two types of synchronization: direct sync and full sync.
Direct sync
A direct sync occurs when a user or group is created, updated or deleted in authentik, or when a user is added to or removed from a group. When any of these events occur, the direct sync automatically syncs those changes to Google Workspace.
Full sync
A full sync occurs when the provider is initially created and when it is saved. During a full sync, all users and groups that match the User filtering settings are processed and created or updated in Google Workspace. After the initial sync, authentik automatically performs a full sync every four hours to maintain consistency between users and groups.
During the full sync, if a user or group exists in both authentik and Google Workspace, authentik will automatically link them.
Additionally, any users or groups present in authentik but absent in Google Workspace will be created and linked.
Deletion and offboarding
The provider's User deletion action and Group deletion action control what happens to the linked Google Workspace object when you delete its counterpart in authentik. Both settings default to Delete. Deletion is processed by a background sync task and requires the provider to remain assigned to an application. Dry-run mode prevents changes to the remote directory.
| Action | When an authentik user is deleted | When an authentik group is deleted |
|---|---|---|
Delete (delete, default) |
Deletes the linked Google Workspace user account. | Deletes the linked Google Workspace group. |
Suspend (suspend) |
Keeps the Google Workspace account and disables sign-in by setting suspended to true. |
Unsupported. Treated as Do Nothing, leaving the remote group unchanged. |
Do Nothing (do_nothing) |
Leaves the Google Workspace account unchanged, including its enabled or suspended status. | Leaves the Google Workspace group unchanged. |
All three actions remove authentik's connection record for the deleted user or group. Suspend retains the remote user account; it does not retain the deleted authentik user. Do Nothing does not revoke access to the remote account.
In the Admin interface, User deletion action offers Delete, Suspend, and Do Nothing. Suspension applies only to users, so Group deletion action offers Delete and Do Nothing.
Deactivate a user without deleting the account
Marking an authentik user inactive is an update, so it does not use User deletion action. With the default user property mapping, authentik sets suspended to true in Google Workspace. The authentik user and its connection record remain, and reactivating the user allows the default mapping to enable the remote account again.
This requires the user to remain included in synchronization. Custom property mappings can change whether active status is synchronized.
Offboard users and groups
- To retain a user's accounts while disabling sign-in, mark the authentik user inactive and verify that synchronization has disabled the Google Workspace account before removing the user from synchronization filters.
- To delete an authentik user while retaining the remote account, select Suspend for User deletion action before deleting the user. Use Do Nothing only if you intend to manage the remote account's access separately.
- To delete the remote user or group as well, use Delete. Complete any required data retention or ownership transfers in Google Workspace before deleting the authentik object.
- After offboarding, check the provider's sync tasks for errors and verify the account or group state in Google Workspace.
Removing a user from the provider's filtering group, changing User filtering to exclude the user, or skipping a user with SkipObject does not itself delete or suspend the remote account. These changes exclude the user from provisioning updates. Removing group membership can also remove that membership in Google Workspace, but it does not disable the account.
Do not rely on filtering alone to revoke access. If you later delete a previously linked authentik user, its retained connection record still allows the configured deletion action to run.
Error handling
Property mappings are evaluated in name order. If a property mapping fails to evaluate, authentik stops the synchronization and does not evaluate the remaining mappings.
To handle network interruptions, authentik detects transient request failures and retries sync tasks.
Property mapping
There are several considerations regarding how authentik data is mapped to Google Workspace user and group data.
Users
For users, authentik only saves the full display name, while Google requires the first (given) name and the family name separately, and as such authentik attempts to separate the full name automatically with the authentik default Google Workspace Mapping: User property mapping.
By default, authentik maps a user’s email address, name, and active status.
Refer to Google documentation for further details on which attributes can be mapped: Google Workspace Reference - Resource: User
Groups
For groups, Google Workspace groups require an email address. Therefore the Google Workspace provider has an Default group email domain setting, which will be used in conjunction with the group’s name to generate an email address. This can be customized with a property mapping.
By default, authentik only maps a group's name.
Refer to Google documentation for further details on which attributes can be mapped: Google Workspace Reference - Resource: Group
Skip objects during synchronization
To exclude specific users or groups from Google Workspace synchronization, you can create a property mapping that raises the SkipObject exception. When this exception is raised during the evaluation of a property mapping, the object is skipped and the sync continues with the next object.
For more information, refer to Skip objects during synchronization.
Add Secure Apps Providers Ldap Index (`website/docs/add-secure-apps/providers/ldap/index.mdx`)
title: LDAP Provider toc_max_heading_level: 5 sidebar_position: 4 sidebar_label: "LDAP Provider"
The LDAP provider allows you to integrate with Service Providers using LDAP. It supports secure connections via LDAPS, code-based MFA authentication, basic LDAP schema compatibility, and can also be integrated with SSSD for authentication on Linux-based systems.
Refer to our documentation to learn how to create an LDAP provider.
LDAP directory
All users and groups in authentik's database are searchable via the LDAP directory served by the LDAP provider.
Base DN
You can configure under which Base DN the LDAP directory should be available. The default is: DC=ldap,DC=goauthentik,DC=io
The setting is available under Protocol settings on the LDAP provider.
:::info Base DN when using multiple LDAP providers
When using multiple LDAP providers, each LDAP provider must have a unique Base DN. You can achieve this by prepending an application-specific OU or DC. e.g. OU=appname,DC=ldap,DC=goauthentik,DC=io
:::
Users
Users are located under: ou=users,
To aid compatibility, each user belongs to its own "virtual" group, as is standard on most Unix-like systems. This group does not exist in the authentik database, and is generated on the fly. These virtual groups are located under the ou=virtual-groups, DN. They have the same attributes as groups but have an additional objectClass: goauthentik.io/ldap/virtual-group. The gidNumber attribute of each virtual group is equal to the uidNumber of the user.
The following attributes are returned for users:
| Attribute | Description |
|---|---|
cn |
User's username |
uid |
Unique user identifier |
uidNumber |
A unique numeric identifier for the user |
name |
User's name |
displayName |
User's display name |
mail |
User's email address |
objectClass |
List of these strings: "user", "organizationalPerson", "goauthentik.io/ldap/user" |
memberOf |
List of all DNs that the user is a member of |
homeDirectory |
Default home directory path for the user, by default /home/$username. Can be overwritten by setting homeDirectory as an attribute on users or groups. |
ak-active |
true if the account is active, otherwise false |
ak-superuser |
true if the account is part of a group with superuser permissions, otherwise false |
:::info Custom attributes
Any custom attributes you set are also returned as LDAP attributes. Built-in attributes will be overwritten by custom attributes with matching names. Periods and slashes in custom attributes are sanitized.
:::
Groups
Groups are located under: ou=groups,
The following attributes are returned for groups:
| Attribute | Description |
|---|---|
cn |
The group's name |
uid |
Unique group identifier |
gidNumber |
Unique numeric identifier for the group |
member |
List of all DNs of the group's members, including groups which have this group as their parent group |
memberOf |
The DN of the parent group if this group has a parent group |
objectClass |
List of these strings: "group", "goauthentik.io/ldap/group" |
:::info Custom attributes
Any custom attributes you set are also returned as LDAP attributes. Built-in attributes will be overwritten by custom attributes with matching names. Periods and slashes in custom attributes are sanitized.
:::
LDAPS via SSL or StartTLS
The LDAP provider supports secure connections via LDAPS using SSL or StartTLS.
You can configure SSL or StartTLS by configuring the Certificate and TLS Server Name settings on the provider.
The provider will pick the correct certificate based on the configured TLS Server Name setting. The certificate is not picked based on the Bind DN, because the StartTLS operation should occur before the bind request to ensure that bind credentials are transmitted over TLS.
Configuring SSL or StartTLS enables you to bind on port 636 using LDAPS.
Binding
Binding against the LDAP provider uses a flow in the background. This allows you to use the same policies and flows as you do for web-based logins.
The Bind Flow determines the flow used for binding/authenticating users, and the Unbind Flow determines the flow used when unbinding/de-authenticating users. Each is set under Flow settings on the LDAP provider.
The following flow stages are supported by the LDAP provider:
- Identification stage
- Password stage
- Authenticator validation stage
- User Logout stage
- User Login stage
- Deny stage
Bind with an app password
An app password can replace the user's regular password in an LDAP bind. To enable this:
- In the Admin interface, open the LDAP provider under Applications > Providers and identify its Bind Flow.
- Open that flow under Flows and Stages > Flows and locate its password stage. If the identification stage has a Password stage configured, use that stage.
- Edit the password stage under Flows and Stages > Stages and select User database + app passwords in Backends.
- Configure the LDAP client with the user's bind DN, such as
cn=ldapservice,ou=users,dc=ldap,dc=goauthentik,dc=io, adjusted for your username and Base DN. Use the generated app password as the bind password.
The app password must belong to the user in the bind DN and must not have expired. An API token cannot be used as an app password.
An app password satisfies the password stage only. Other stages and policies in the Bind Flow, including MFA requirements, still apply unless explicitly skipped by a policy. If the flow requires MFA, configure a supported method as described in Code-based MFA support. The user must also have access to the LDAP application.
Bind modes
The LDAP provider supports two different bind modes:
Direct bind
In this mode, the outpost will always execute the configured flow when a new bind request is received.
Cached bind
This mode uses the same logic as direct bind, however the result is cached for the entered credentials, and saved in memory for the standard session duration. Sessions are saved independently, meaning that revoking sessions does not remove them from the outpost, and neither will changing a users credentials.
Searching
A user must have access to the LDAP application before they can bind and search the directory. If the application uses bindings, they must allow the user access according to the application's Policy engine mode.
By default, users can search only for their own user details and the groups they belong to. Group results include only the searching user as a member.
To search the full directory, add the user to a role and assign the role the Search full LDAP directory permission. This permission allows the user to retrieve all users and groups that the LDAP provider exposes.
You can assign the permission in one of two ways:
- Object permission (recommended): Open the LDAP provider's Permissions tab, click Assign Role Object Permission, select the role, enable Search full LDAP directory, and click Assign Role Object Permission. This permission applies only to that LDAP provider.
- Global permission: Open the role's Permissions tab and assign Search full LDAP directory under Assigned global permissions. This permission applies to every LDAP provider, but the user still needs access to each provider's application. For detailed instructions, see Manage permissions.
Search modes
The LDAP provider supports two different search modes:
Direct search
In this mode, every LDAP search request will trigger one or more requests to the authentik core API. This will always return the latest data, however this has a performance hit due to all the layers the backend requests have to go through.
Cached search
In this mode, the outpost periodically fetches all users and groups from the backend, holds them in memory, and responds to search queries directly. This improves performance, but can return stale data.
Code-based MFA support
:::info Authenticator support
Authenticator validation currently only supports DUO, TOTP and static authenticators. SMS-based authenticators are not supported as they require a code to be sent from authentik, which is not possible during the bind.
:::
The LDAP provider supports code-based MFA.
Code-based authenticators are only supported when the Code-based MFA Support setting is enabled on the provider and the configured Bind Flow includes a Authenticator Validation stage.
When enabled, all users that bind to the LDAP provider should have a supported authenticator configured, as otherwise a password might be incorrectly rejected if it contains a semicolon.
For code-based authenticators, the code must be given as part of the bind/authentication password, separated by a semicolon.
For example, for the password example-password and the MFA code 123456, the input must be example-password;123456.
Add Secure Apps Providers Oauth2 Index (`website/docs/add-secure-apps/providers/oauth2/index.mdx`)
title: OAuth 2.0 provider
In authentik, you can create an OAuth 2.0 provider to authenticate users to an associated application. The provider supports both OAuth 2.0 and OpenID Connect (OIDC).
authentik and OAuth 2.0
Before taking a closer look at OAuth 2.0 and OIDC, it is important to understand how authentik works with these protocols.
authentik can act as either an OpenID Provider (OP) or a Relying Party (RP):
- To use authentik as an OP, create an OAuth 2.0 provider and associate it with an application.
- To use authentik as an RP, configure an OAuth or OIDC source.
authentik can act as both an OP and an RP in the same deployment.
authentik supports common OAuth 2.0 and OIDC flows and grant types, including authorization code, client credentials, implicit, hybrid, device code, refresh token, and token exchange. authentik follows the OpenID Connect specification and supports PKCE, GitHub compatibility, and scope mappings.
The authentik OAuth 2.0 provider supports standard OAuth 2.0 security features, including secure credential storage, configurable signing and encryption, configurable token expiration times, and automatic refresh token rotation.
About OAuth 2.0 and OIDC
OAuth 2.0 is an authorization framework that allows an application to obtain limited access to protected resources. OpenID Connect is an authentication protocol built on OAuth 2.0 that allows an application to verify a user's identity and obtain information about that user.
In a typical authorization code flow:
- The RP prepares an authorization request that identifies the client and specifies the access it requires. The RP then redirects the user's browser to the OP.
- The OP authenticates the user and, when required, requests the user's consent.
- The OP redirects the user's browser back to the RP with an authorization code.
- The RP sends the authorization code to the OP's token endpoint and authenticates using its client credentials or another supported client authentication method.
- The OP returns an access token and, when requested and permitted, a refresh token.
The following diagram shows a typical authorization code flow:
sequenceDiagram
participant user as User
participant rp as RP (Relying Party)
participant op as OP (OpenID Provider)
user->>rp: User accesses application
rp->>user: RP prepares authorization request and redirects user to OP
user->>op: User authentication and authorization occurs
op->>rp: Redirect back to the RP with an authorization code
rect
rp->>op: Exchange authorization code
op->>rp: RP receives access token and optional refresh token
end
rp->>user: User is logged inOAuth 2.0 endpoints and bindings
| Endpoint | URL |
|---|---|
| Authorization | /application/o/authorize/ |
| Token | /application/o/token/ |
| User Info | /application/o/userinfo/ |
| Token Revocation | /application/o/revoke/ |
| Token Introspection | /application/o/introspect/ |
| Device Authorization | /application/o/device/ |
| End Session | /application/o/<application_slug>/end-session/ |
| JWKS | /application/o/<application_slug>/jwks/ |
| OpenID Configuration | /application/o/<application_slug>/.well-known/openid-configuration |
:::caution Reserved application slugs
Because of how the OAuth 2.0 provider endpoints are structured, you cannot create applications with the slugs authorize, token, device, userinfo, introspect, or revoke. These slugs conflict with the global OAuth 2.0 endpoints.
:::
Reverse proxy and firewall access
OAuth 2.0 and OIDC clients access some endpoints directly from the application server instead of through a user's browser. Ensure that reverse proxies, content delivery networks (CDNs), web application firewalls, and bot protection services permit these server-to-server requests. Interactive challenges on endpoints such as the OpenID configuration and JWKS endpoints can prevent clients from validating tokens and can cause repeated authentication redirects.
If an endpoint returns 403 Forbidden, inspect the proxy or firewall logs. For example, Cloudflare Browser Integrity Check can reject clients that use non-standard user agents. Configure a narrowly scoped Cloudflare configuration rule or custom skip rule for the affected endpoint. Do not disable security controls for the entire authentik deployment.
The JWKS endpoint is intentionally publicly accessible and contains public keys that clients use to verify tokens. It does not expose the private signing key.
Cross-provider token introspection and revocation
The token introspection and revocation endpoints are global OAuth 2.0 endpoints, but access to tokens remains scoped by provider. A confidential provider can introspect tokens that it issued. Both public and confidential providers can revoke their own tokens.
To allow confidential provider B to introspect or revoke tokens issued by provider A, open provider A and add provider B under Federated OAuth2/OpenID Providers. Authenticate introspection and revocation requests using provider B's client credentials. This permission is directional and does not grant provider A access to provider B's tokens.
Redirect URIs
When using an OAuth 2.0 provider in authentik, the OP must validate the redirect URI supplied by the RP. An authentik administrator can configure a list of allowed redirect URIs in the provider's Redirect URIs field.
If you leave the Redirect URIs field empty when creating a provider and application, authentik saves the redirect URI used the first time a user opens the application.
For advanced use cases, an authentik administrator can use regular expressions instead of exact redirect URIs. For example, instead of listing several similar application URLs individually, you can create a regular expression that matches all of them.
When using regular expressions, remember that a period (.) matches any single character. To match a literal period in a URL, escape it as \..
OAuth 2.0 and OpenID Connect logout
Back-channel logout is a server-to-server notification mechanism that allows an identity provider to notify connected OAuth 2.0 or OpenID Connect clients when a user's session ends.
For more information, see OAuth2/OpenID Connect front-channel and back-channel logout.
Issuer mode
The Issuer mode setting (under Advanced protocol settings) controls the value that authentik uses for the iss (issuer) claim in the tokens it signs, and for the issuer field in the provider's OpenID Connect discovery document.
| Mode (UI label) | iss value |
|---|---|
| Each provider has a different issuer, based on the application slug (default) | https://authentik.company/application/o/<application_slug>/ |
| Same identifier is used for all providers | https://authentik.company/ |
By default, authentik uses per-provider mode: every provider has a unique issuer derived from its application slug. This is the recommended setting, and matches how the discovery and JWKS endpoints are structured, since both are served under the per-application /application/o/<application_slug>/ path.
Global issuer mode
Setting the issuer mode to Same identifier is used for all providers (referred to internally as global mode) makes every OAuth 2.0 provider configured with this mode share the same issuer: the root URL of the instance (https://authentik.company/).
:::info Well-known location
Global issuer mode still serves the discovery document at https://authentik.company/application/o/<application_slug>/.well-known/openid-configuration, not at the root issuer URL.
:::
OAuth 2.0 flows and grant types
authentik supports the following general OAuth 2.0 and OpenID Connect flows:
- Web-based application authorization
- Client credentials
- Device code
- Token exchange
The refresh token grant allows a client to obtain new access tokens without repeating the original authorization flow.
You can define which grant types are available for your OAuth2 provider when you create and configure the provider. By default, all types are selected.
1. Web-based application authorization
Web-based application authorization typically involves a user authenticating to an application. authentik supports the following flows and grant types for this use case:
- Authorization code
- Implicit (legacy)
- Hybrid
Authorization code
The authorization code flow is intended for applications that can exchange an authorization code securely at the token endpoint. The application redirects the user to the OP for authentication and receives an authorization code through the user's browser. The application's backend then exchanges that code for an access token and, when requested and permitted, a refresh token.
Confidential clients authenticate to the token endpoint using a client ID and client secret or another supported client authentication method. Public clients, which cannot securely store a client secret, should use the authorization code flow with PKCE.
The authorization code can be used only once and expires after a short period.
To receive a refresh token, the client must request the offline_access scope, and the provider must include the offline_access scope mapping.
:::info
Starting with authentik 2024.2, applications receive only an access token by default. To receive a refresh token, the application must request the offline_access scope, and the authentik provider must include the offline_access scope mapping.
:::
Implicit
:::warning
The OAuth 2.0 Security Best Current Practice recommends against using the implicit grant. Browser-based applications should use the authorization code flow with PKCE instead.
:::
The implicit flow returns tokens directly from the authorization endpoint without exchanging an authorization code at the token endpoint. It was designed for browser-based applications that could not securely store client credentials.
Because tokens can be exposed through browser history, redirect URIs, and other browser mechanisms, the implicit flow is considered a legacy flow and should not be used for new applications.
Hybrid
The OpenID Connect hybrid flow combines elements of the authorization code and implicit flows. It can return an ID token directly from the authorization endpoint while providing an authorization code that the application exchanges for access and refresh tokens at the token endpoint.
This flow can be useful when an application needs to verify the user's identity immediately while securely obtaining additional tokens through a back-channel request.
2. Client credentials
The client credentials flow is typically used for machine-to-machine or server-to-server authentication, where no user is involved. For example, a web service might use client credentials to authenticate when calling an API.
For more information, see Machine-to-machine authentication.
3. Device code
The device code flow is intended for devices that have limited input capabilities or do not have a suitable browser. For example, a television application can display a code that the user enters on a website using a phone or computer. After the user authenticates, the television application receives authorization.
For more information, see Device code flow.
4. Token exchange
The token exchange grant allows a client to exchange an existing token for a new access token. authentik supports both impersonation and delegation as defined by RFC 8693.
With delegation, also known as on-behalf-of (OBO) token exchange, the issued token identifies both the user and the authentik Actor acting on the user's behalf.
For configuration instructions and information about supported parameters, see Token exchange.
:::info
Delegation and on-behalf-of token exchange are available in authentik 2026.8 and later.
:::
Refresh token grant
The refresh token grant allows a client to obtain a new access token without requiring the user to authenticate again. Depending on the provider's configuration, authentik can also rotate the refresh token when it is used.
Scope mappings
Scopes can be configured using scope mappings, which are a type of property mapping.
Scope authorization
By default, every user who has access to an application can request any of the scopes configured on its provider. Starting with authentik 2022.4, you can perform additional scope checks using an expression policy bound to the application:
# Additional fields are available in the context.
# Use `ak_logger.debug(request.context)` to inspect them.
if "my-admin-scope" in request.context["oauth_scopes"]:
return ak_is_group_member(request.user, name="my-admin-group")
return TrueDefault and special scopes
For authorization requests, when a client does not request any scopes, authentik treats the request as though all configured scopes were requested. Depending on the configured authorization flow, the user might still need to provide consent, and the consent page lists all requested scopes.
This behavior does not apply to special scopes because they are not configurable on the provider. It also does not apply to token exchange: if scope is omitted from a token exchange request, the issued token has no scopes.
Default scopes
openid: Indicates that an OAuth 2.0 interaction is an OpenID Connect request. This scope does not add data to the token.profile: Includes basic profile information, such as the user's username, name, and group membership.email: Includes the user's email address.entitlements: Includes application entitlement data.offline_access: Indicates that the application is requesting a refresh token.bound_key: Requests an ID token bound to a client-held key using OpenID Connect Key Binding and Demonstrating Proof of Possession (DPoP). See OpenID Connect key binding for configuration, proof requirements, and a client example.
:::info bound_key scope
The bound_key scope applies OpenID Connect Key Binding to the ID token. It does not bind the access token to the client's key.
:::
authentik scopes
goauthentik.io/api: Grants access to the authentik API on behalf of the user.goauthentik.io/oidc/dcr: Allows the client to register new OAuth 2.0 clients using Dynamic Client Registration.
GitHub compatibility scopes
user: Accepted for compatibility but does not grant access to any resources.read:user: Accepted for compatibility but does not grant access to any resources.user:email: Grants read-only access to/user, including the user's email address.read:org: Grants read-only access to/user/teams, which lists the user's groups as teams.
Email scope verification
Some applications require the email_verified claim to be True. Before authentik 2025.10, the email scope always returned True for this claim, even though authentik has no single authoritative source for email verification. This could assert that an unverified address was verified. Starting with authentik 2025.10, the claim defaults to False.
To configure the claim using an existing verification process or an authentik flow, see Verify email addresses.
Signing and encryption
JWTs created by authentik are always signed.
When a Signing Key is selected in the provider, authentik signs JWTs asymmetrically using the private key of the selected certificate-key pair. Clients can verify the signature using the corresponding public key. The signing key's public key is available through the JWKS endpoint listed on the provider page.
When no Signing Key is selected, authentik uses HS256 and the provider’s Client secret to sign JWTs. This does not publish a public signing key through JWKS; select a certificate key pair to use asymmetric signing, such as RS256.
Encryption
authentik can also encrypt the JWTs it issues, producing JSON Web Encryption (JWE) tokens. To enable encryption, select an Encryption Key in the provider.
authentik uses the RSA-OAEP-256 key encryption algorithm with the A256CBC-HS512 content encryption method.
Add Secure Apps Providers Property Mappings Index (`website/docs/add-secure-apps/providers/property-mappings/index.mdx`)
title: Provider property mappings sidebar_position: 1 sidebar_label: "Property Mappings"
Provider property mappings send information from authentik to integrated applications. For example, a SAML property mapping can send a user's groups to an application as a SAML attribute.
To map data from a source into authentik instead, see source property mappings.
Choose a property mapping type
Select the mapping type that matches the provider. Each type expects a different result from its expression.
| Mapping type | Use |
|---|---|
| SAML property mapping | Send an attribute to an integrated application in a SAML assertion. |
| OAuth2/OIDC scope mapping | Add claims that an OAuth2/OIDC application can request through a scope. |
| Proxy scope mapping | Send dynamic headers to a proxied application or configure other proxy behavior. |
| RADIUS property mapping | Add attributes to the RADIUS response sent to a client. |
| RAC property mapping | Configure credentials and connection settings for an integrated RAC endpoint. |
| Synchronization provider mapping | Build user or group data for integrated services such as SCIM, Google Workspace, and Microsoft Entra ID. |
Create a custom provider property mapping
If the default mappings do not send the data that your application needs, create a custom mapping.
- Log in to authentik as an administrator and open the Admin interface.
- Navigate to Customization > Property Mappings.
- Click New Property Mapping.
- Select the mapping type that matches your provider, and then click Next.
- Enter a Name and configure the fields for that mapping type. Most mapping types include an Expression field.
- Click Finish.
- Open the provider or endpoint that should use the mapping.
- Add the mapping to the appropriate field, such as Property mappings, User Property Mappings, Group Property Mappings, or Scopes.
- Save the provider or endpoint.
Write a mapping expression
Most property mappings use a Python expression to create their output. The required output depends on the mapping type. For example:
- A SAML property mapping returns a value, such as a string or a list of group names.
- An OAuth2/OIDC scope mapping returns a dictionary of claim names and values.
- A synchronization mapping returns data in the format that the integrated service expects.
Returning None skips the mapping. For the available functions, objects, and variables, see Property mapping expressions.
Map stored user attributes
A property mapping reads user data and sends it to an integrated application. It does not collect or store data on the user. If you collect data with prompt fields in an enrollment flow, add a User Write stage to store the data on the user first.
A mapping can read built-in user properties, such as user.name, and custom user attributes. Use ak_obj_attr() to read a custom attribute. The name sent to the application does not need to match the key stored on the user.
Example:
A user stores the custom attributes given_name and family_name, but an OAuth2/OIDC application expects the claims first_name and last_name. A scope mapping can rename the values:
return {
"first_name": ak_obj_attr(user, "given_name", user.name),
"last_name": ak_obj_attr(user, "family_name", ""),
}For SAML, create a SAML property mapping for each value. Set SAML Attribute Name to the name that the application expects, and return the stored value:
return ak_obj_attr(user, "given_name", user.name)Different applications can use different names for the same stored attribute.
SAML property mappings
A SAML property mapping adds an attribute to the SAML assertion that authentik sends to the service provider (SP). It does not add data to the authentication request that authentik receives from the SP.
See SAML property mappings for the default mappings and more details.
Scope mappings with OAuth2
An OAuth2/OIDC scope mapping defines a scope and the claims that authentik returns when a client requests that scope. The expression must return a dictionary.
The client must request the scope, and the scope mapping must be assigned to the provider. If either condition is missing, authentik does not return the mapping's claims.
The returned claims are available from the UserInfo endpoint. authentik includes them in the ID token and access token only when Include claims in id_token is enabled on the provider.
See Scope mappings for scope authorization, default scopes, and special scopes.
Synchronization property mappings
Synchronization providers use property mappings to build the user and group data that they send to integrated services. The mapping must return data in the format that the integrated service expects.
:::warning Property mapping errors
Synchronization providers evaluate property mappings in name order. If a property mapping fails to evaluate, authentik stops the synchronization and does not evaluate the remaining mappings. Other provider types generally record the error and continue with the next property mapping.
:::
Refer to the provider documentation for supported fields and examples:
Skip objects during synchronization
For SCIM, Google Workspace, and Microsoft Entra ID, raise SkipObject to skip the current user or group. The synchronization continues with the next object.
Example:
if user.username == "example_username":
raise SkipObjectOnly synchronization mappings handle SkipObject. It does not apply to SAML attributes or OAuth2/OIDC claims.
Add Secure Apps Providers Proxy Index (`website/docs/add-secure-apps/providers/proxy/index.mdx`)
title: Proxy provider sidebar_position: 7 sidebar_label: "Proxy Provider"
The proxy provider protects applications that do not support native authentication protocols such as OIDC, SAML, or LDAP.
Depending on the selected mode, one of the following happens:
- The authentik outpost proxies requests to the upstream application.
- Your existing reverse proxy handles the application traffic and asks the authentik outpost to check authentication and authorization.
Refer to the create a proxy provider documentation for setup instructions.
sequenceDiagram
participant u as User accesses service
participant rp as Reverse proxy
participant ak as authentik
participant s as Service
u->>rp: Initial request
rp->>ak: Checks authentication
alt User is authenticated
ak ->> rp: Successful response
rp ->> s: Initial request is forwarded
else User needs to be authenticated
ak ->> rp: Redirect to the login page
rp ->> u: Redirect is passed to enduser
endProxy modes
The proxy provider supports the following modes:
| Mode | Use when |
|---|---|
| Proxy | The authentik outpost should proxy traffic to one upstream application. |
| Forward auth (single application) | Your existing reverse proxy should proxy traffic to one application and use authentik only for authentication checks. |
| Forward auth (domain level) | Your existing reverse proxy should use one proxy provider to protect multiple applications under the same parent domain. |
Domain-level forward auth cannot enforce different application-level authorization rules for each protected application. Use single-application mode when each application needs its own policies, bindings, or authorization behavior.
Headers sent to upstream applications
The proxy outpost sets the following user-specific headers:
| Header | Example value | Description |
|---|---|---|
X-authentik-username |
akadmin |
Username of the currently logged in user. |
X-authentik-groups |
foo|bar|baz |
Groups the user is a member of, separated by pipes. |
X-authentik-entitlements |
foo|bar|baz |
Entitlements the user has for the application, separated by pipes. |
X-authentik-email |
root@localhost |
Email address of the currently logged in user. |
X-authentik-name |
authentik Default Admin |
Full name of the currently logged in user. |
X-authentik-uid |
900347b8a29876b45ca6f75722635ecfedf0e931c6022e3a29a8aa13fb5516fb |
Hashed identifier of the currently logged in user. |
The proxy outpost also sets the following application-specific headers:
| Header | Example value | Description |
|---|---|---|
X-authentik-meta-outpost |
authentik Embedded Outpost |
Name of the authentik outpost. |
X-authentik-meta-provider |
test |
Name of the authentik provider. |
X-authentik-meta-app |
test |
Slug of the authentik application. |
X-authentik-meta-version |
goauthentik.io/outpost/1.2.3 |
Version of the authentik outpost. |
X-Forwarded-Host |
app.company |
Original host sent by the client. Only set in proxy mode. |
In proxy mode, X-Forwarded-Host preserves the original Host header sent by the client because the Host header is set to the configured upstream host.
Additional headers
You can set the additionalHeaders attribute on groups or users to send additional static headers:
additionalHeaders:
X-test-header: test-valueFor dynamic headers, see the custom headers documentation.
If an upstream application cannot handle non-ASCII header values, use a scope mapping to percent-encode them.
HTTPS
The outpost listens on port 9000 for HTTP and port 9443 for HTTPS.
:::info
If your upstream host is HTTPS, and you're not using forward auth, you need to access the outpost over HTTPS too.
:::
Log out
Login is initiated automatically when you visit the protected application without a valid cookie.
To log out, navigate to /outpost.goauthentik.io/sign_out on the host that serves the outpost:
- In proxy mode and forward auth single-application mode, use the protected application host, for example
https://app.company/outpost.goauthentik.io/sign_out. - In forward auth domain-level mode, use the authentication URL configured for the provider, for example
https://auth.company/outpost.goauthentik.io/sign_out.
Logging out of a provider invalidates all sessions for that user within the respective outpost.
Proxy sessions are also ended when the user's authentik session ends. For more information, see Single Logout for proxy providers and outposts.
Allow unauthenticated requests
To allow unauthenticated requests to specific paths or URLs, use the Unauthenticated Paths or Unauthenticated URLs field on the proxy provider.
Each new line is interpreted as a regular expression and is compiled and checked using the Rust regex crate.
A pattern that fails to compile is skipped, and a warning is written to the outpost logs. The remaining patterns still apply, so a typo silently leaves a path authenticated rather than causing an error.
The behavior of this field changes depending on the selected mode.
Proxy and Forward auth (single application)
In these modes, the regular expressions are matched against the request path.
Forward auth (domain level)
In this mode, the regular expressions are matched against the full request URL, including the scheme and host.
Dynamic backend selection
In proxy mode, you can configure the upstream backend dynamically with scope mappings.
Create a scope mapping with a name and scope of your choice, and set the expression to:
return {
"ak_proxy": {
"backend_override": f"http://foo.bar.baz/{request.user.username}"
}
}Edit the proxy provider and add this mapping under Additional scopes. The expression is evaluated only when the user logs in to the application.
Host header:ak-version[2025.6.1]
By default, the proxy provider uses the forwarded host header received from the client. Starting with authentik 2025.6.1, you can dynamically adjust the host header with a property mapping.
Create a scope mapping with a name and scope of your choice, and set the expression to:
return {
"ak_proxy": {
"host_header": "my-internal-host-header"
}
}Edit the proxy provider and add this mapping under Additional scopes. The expression is evaluated only when the user logs in to the application.
Dynamically setting host header
You can dynamically set the host header to match the Internal host value set on the proxy provider. To do this, create a scope mapping with a name and scope of your choice, and set the expression to:
from urllib.parse import urlparse
parsed_url = urlparse(provider.proxyprovider.internal_host)
return {
"ak_proxy": {
"host_header": parsed_url.netloc
}
}Edit the proxy provider and add this mapping under Additional scopes. The expression is evaluated only when the user logs in to the application.
Proxy authentication
When a user authenticates to the proxy, authentik uses OAuth2 behavior configured on the proxy provider. For header-based authentication options, see Header authentication and Machine-to-Machine.
Troubleshooting
To obtain more detailed information about a failure, search the logs of the outpost or server container for the client_id of the proxy provider. The client_id is shown on the provider's Authentication tab.
Add Secure Apps Providers Rac Index (`website/docs/add-secure-apps/providers/rac/index.mdx`)
title: Remote Access Control (RAC) Provider sidebar_position: 8 sidebar_label: "RAC (Remote Access Control) Provider"
The RAC provider allows users to access remote Windows, macOS, and Linux machines via RDP/SSH/VNC. Just like other providers in authentik, the RAC provider is associated with an application that appears on a user's Application Dashboard page.
For instructions on creating a RAC provider, refer to the Create a Remote Access Control (RAC) provider documentation. Alternatively, watch our "Remote Access Control (RAC) in authentik" video on YouTube.
RAC components
A RAC provider uses several components:
architecture-beta
service application(mdi:application-outline)[Application]
service provider(mdi:application-cog-outline)[Provider]
service device(mdi:network-pos)[Device]
service server(mdi:server)[authentik Server]
service outpost(mdi:server-plus)[RAC Outpost]
service machine(mdi:desktop-classic)[Remote Machine]
application:R --> L:provider
provider:B -- T:device
provider:R --> L:server
server:R <--> L:outpost
outpost:B <--> T:machineWhen a user starts the RAC application, it communicates with the authentik server, which then connects to the RAC outpost and sends instructions (based on the device that is being connected to) on how to connect to the remote machine.
After connecting to the remote machine, the outpost sends a message back to the authentik server (via WebSockets), and the web browser opens the WebSocket connection to the remote machine.
Devices
Unlike other providers, where an application-provider pair is created for each resource you wish to access, RAC works differently. RAC uses a single application connected to one RAC provider, and that provider connects to the devices in your authentik instance.
A device is the same object that connectors such as the authentik agent enroll and report facts for, so a machine only has to exist in authentik once.
A device that is enrolled through a connector is reached on the address it reports: its hostname, or its first non-local interface address. Which protocols it accepts is taken from its facts too: the authentik agent reports the RDP certificate fingerprint and the SSH host keys of its device, and a device is offered for the protocols it has those for. A device that reports neither is offered for both RDP and SSH, and the user picks when launching it.
A device that is not enrolled, such as a server, has no facts to take any of this from, so it is added with a connection override instead. The override sets the host and the single protocol for that one device, and takes precedence over what a device reports. The provider's connection limit applies either way.
To connect to a device, users must have access to the application that the RAC provider is using, and pass the policies bound to the device. Because policies are bound to the device itself, a device's reported facts can gate remote access; see Restricting access with device compliance. A provider can additionally be limited to a single device access group.
:::info
Connection credentials belong in a RAC property mapping or the credentials prompt, not in a connection override.
:::
Signing in with the authentik agent
A device that is enrolled through the authentik agent is signed into as the authentik user who launched the connection, without any credentials being configured for it.
authentik issues a short-lived token for the device and the user, the RAC outpost turns it into an SSH certificate carrying that token, and the agent on the device validates the token with authentik before accepting the login. The certificate is bound to the device's SSH host key, so it cannot be used to log in anywhere else.
This applies to SSH connections to devices which report SSH host keys. RAC property mappings are evaluated afterwards, so a device can still be connected to with static credentials by setting a username and password there.
Restricting access with device compliance
Devices that are enrolled through a connector report facts about themselves, such as their operating system version or whether their disks are encrypted. Binding an expression policy to a device, or to a device access group, lets you require those facts before a connection is authorized:
facts = request.obj.cached_facts.data
return facts.get("os", {}).get("family") == "windows"The device that is being connected to is also available to the policies and stages of the provider's authorization flow as request.context["rac_device"].
Connection management
Launching a RAC application/device from the User interface runs the provider's authorization flow and creates a connection authorization tied to the user's current authentik session. This authorization allows the browser to connect to that device. You can view and delete stored connection authorizations from the Connections tab of the RAC provider.
Delete authorization on disconnect
The RAC provider's Delete authorization on disconnect setting is disabled by default.
- When disabled, the connection authorization remains available after a disconnect. The browser can reuse it to reconnect to the same device without repeating the authorization flow, provided that the authorization and the authentik session are still valid. This allows reconnection after a temporary network failure. Launching the application/device again starts a new authorization flow rather than reusing the previous authorization.
- When enabled, the authorization cannot be reused. After a disconnect, the user must launch the application/device again and complete the provider's authorization flow. This also applies when a temporary network failure interrupts the connection, so enabling the setting can cause repeated authorization prompts on unstable networks. The prompts depend on the stages configured in the authorization flow; reauthorization does not necessarily require logging in to authentik again.
Although the UI describes deletion as happening on disconnect, authentik deletes the stored authorization during connection setup, after requesting a connection from the outpost. The current connection continues, but subsequent reconnect attempts cannot use that authorization. A connection attempt that fails after this deletion also requires a new authorization.
Connection and session expiry
Connection expiry limits the authorization's lifetime, starting when authentik creates it. The default is hours=8. Reconnecting with the same authorization does not reset this limit. When it expires, authentik disconnects the RAC connection and requires a new authorization, even if the user is still logged in to authentik.
The connection also ends when the user's authentik session expires or the user logs out. Delete authorization on disconnect controls authorization reuse; it does not extend or replace either expiry limit. Connection expiry still applies to the current connection when the setting is enabled.
A connection authorization is separate from the login session on the remote operating system. Deleting the authorization prevents reuse through authentik; it does not itself log the user out of the remote operating system or terminate applications running there. Whether a remote session survives a disconnected RAC connection depends on the protocol and the remote machine's session policies.
RAC Property Mappings
You can create RAC property mappings via Customization > Property Mappings.
RAC property mappings allow you to configure the following settings:
- Username: the username for the remote machine
- Password: the password for the remote machine
- Ignore server certificate: set whether the validity of the returned RDP server certificate will be ignored
- Enable wallpaper: enable/disable the desktop wallpaper of the RDP server
- Enable font-smoothing: enable/disable font-smoothing (anti-aliasing) on the RDP server
- Enable full window dragging: enable/disable whether the full content of a window is visible while moving it on the RDP server
- Advanced settings: set connection settings via a Python expression
Connection settings
The RAC provider utilizes Apache Guacamole for establishing SSH, RDP and VNC connections. RAC supports the use of Apache Guacamole connection configurations.
Connection settings can include username, password, domain, private-key, security, enable-audio, and more.
For a full list of possible connection settings, see the Apache Guacamole connection configuration documentation.
RAC connection settings can be set via several methods and are all merged together when connecting:
- Default settings
- RAC Provider settings
- The device's address and port
- The certificate for devices managed by the authentik agent
- RAC Provider property mapping settings, which receive the device they are evaluated for
- The
connection_settingsobject in the flow plan
The protocol is not part of this merge: it is fixed when the connection is authorized, either by the device's connection override or by the protocol the user launched.
For examples of how to configure connection settings, see the RAC SSH public key authentication and RAC Credentials Prompt documentation.
Capabilities
The following features are currently supported:
- Bi-directional clipboard
- Audio redirection (from remote machine to browser)
- Resizing
Add Secure Apps Providers Radius Index (`website/docs/add-secure-apps/providers/radius/index.mdx`)
title: RADIUS Provider sidebar_position: 9 sidebar_label: "RADIUS Provider"
import { HashSupport } from "./HashSupport";
You can configure a Radius provider for applications that don't support any other protocols or that require Radius.
:::info
This provider requires the deployment of a RADIUS outpost.
:::
Currently, only authentication requests are supported.
Authentication flow
Authentication requests against the Radius Server use a flow in the background. This allows you to use the same flows, stages, and policies as you do for web-based logins.
The following stages are supported:
- [Identification](../../flows-stages/stages/identification/index.mdx)
- [Password](../../flows-stages/stages/password/index.mdx)
- [Authenticator validation](../../flows-stages/stages/authenticator_validate/index.mdx)
:::info
Authenticator validation currently only supports DUO, TOTP, and static authenticator.
:::
For code-based authenticators, the code must be given as part of the bind password, separated by a semicolon. For example for the password `example-password` and the MFA token `123456`, the input must be `example-password;123456`.
SMS-based authenticators are not supported because they require a code to be sent from authentik, which is not possible during the bind.Protocol support
The RADIUS provider supports EAP-TLS and PAP (Password Authentication Protocol) protocol. For password-based authentication, only PAP protocol is supported due to other password hashing methods requiring reversible password hashes, which we don’t support for security reasons.
RADIUS compatibility matrix for password-based authentication:
This table represents the password-hash compatibility with various RADIUS protocols.
EAP :ak-enterprise {#eap}
authentik supports EAP with TLS as the inner protocol, between the application and transport layers to encrypt and secure communications. To set this up, a certificate authority needs to be available and client certificates need to be installed on machines, the configuration of which is outside of the scope of this document.
EAP-TLS
Create an authentication flow with a Mutual TLS stage as its first stage. This stage should be configured to use your CA's certificate. Afterwards a server certificate needs to be selected in the RADIUS provider (which serves as an outpost). Then, configure your RADIUS provider to use this authentication flow to enable EAP-TLS authentication. After the certificate and the authentication flow are configured in the provider, authentication via EAP-TLS is possible.
For certificates, ensure that you use a client certificate and a server certificate that are created by a certificate authority, not a self-generated certificate.
:::warning Use of trusted Certificate Authority
For EAP-TLS, note that you should NOT use a globally known CA.
Using private PKI certificates that are trusted by the end-device is best practice. For example, using a Verisign certificate as a "known CA" means that ANYONE who has a certificate signed by them can authenticate via EAP-TLS, and in addition you should implement custom validation to prevent unauthorized access.
:::
RADIUS attributes
Starting with authentik 2024.8, you can create RADIUS provider property mappings, which make it possible to add custom attributes to the RADIUS response packets.
For example, to add the Cisco AV-Pair attribute, this snippet can be used:
return {
vendor_attribute(
vendor_code=9,
vendor_name="Cisco",
attribute_name="AV-Pair",
attribute_code=1,
attribute_type="string",
): "shell:priv-lvl=15"
}After creation, make sure to select the RADIUS property mapping in the RADIUS provider.
Add Secure Apps Providers Saml Index (`website/docs/add-secure-apps/providers/saml/index.mdx`)
title: SAML Provider sidebar_position: 10 sidebar_label: "SAML Provider"
The SAML provider allows you to integrate with Service Providers using the SAML2 protocol. It supports importing and exporting SAML metadata, signed requests and uses property mappings to align, or "map", Service Provider and authentik attributes.
Refer to our documentation to learn how to create a SAML provider.
SAML bindings and endpoints
Bindings define how SAML messages are exchanged between an Identity Provider (IdP) and a Service Provider (SP), typically a service or application. Both IdPs and SPs define various endpoints in their metadata, each associated with a specific SAML binding.
A binding defines how SAML messages are transported over network protocols. In authentik, you can select one of two SAML bindings: HTTP Redirect or HTTP POST.
Endpoint URLs specify where and how the messages are sent according to that binding. authentik exposes a unified SAML endpoint that handles both SSO and SLO for both HTTP Redirect and HTTP POST bindings — the operation type is detected from the incoming SAML message:
| Endpoint | URL |
|---|---|
| SAML endpoint (SSO + SLO) | /application/saml/<application_slug>/ |
| SSO (IdP-initiated login) | /application/saml/<application_slug>/init/ |
| Metadata Download | /application/saml/<application_slug>/metadata/ |
:::info Legacy endpoints
The previous binding-specific endpoints (/sso/binding/redirect/, /sso/binding/post/, /sso/binding/init/, /slo/binding/redirect/, /slo/binding/post/) remain available for backward compatibility.
:::
SAML metadata
SAML Metadata ensures that SAML single sign-on works reliably by exchanging and maintaining identity and connection information. SAML metadata is an XML document that defines how IdPs and SPs securely interact for authentication. It includes information such as endpoints, bindings, certificates, and unique identifiers.
Import SP SAML metadata
You can import SP SAML metadata to automatically configure a SAML provider based on the requirements of an SP.
Export authentik SAML metadata
You can export SAML metadata from an authentik SAML provider to an SP to automatically provide important endpoint and certificate information to the SP.
EntityID/Issuer override
By default, authentik uses the SAML provider's metadata URL as the IdP `` / <EntityID> value:
https://authentik.company/application/saml/<application_slug>/metadata/The EntityID/Issuer override field (under Advanced protocol settings on a SAML provider) replaces this default with a custom value. Set it only in the rare case when the Service Provider requires a specific IdP issuer string that doesn't match the metadata URL.
:::info Existing deployments
This field was previously named Issuer. Existing values were preserved during the rename. Don't clear the override unless you also update the SP-side IdP Entity ID / IdP Issuer field to authentik's metadata URL.
:::
Certificates
Certificates are vital for trust and security during SAML authentication and are used for several purposes.
Signing certificates
A signing certificate allows authentik to digitally sign SAML assertions and responses. This certificate contains a private key that creates a cryptographic signature, proving the authenticity and integrity of the transmitted data. The SP then uses the corresponding public key from this certificate to verify the signature. Ensuring the response was not tampered with and that it originated from authentik.
Signing algorithm
Signing algorithms (such as RSA-SHA256 or ECDSA-SHA256) define the cryptographic method used for creating and validating the signatures.
Digest algorithm
A digest algorithm is a cryptographic hash function used to create a fixed-size hash (digest) from the data in the SAML assertion or message. authentik computes a digest value using the chosen algorithm (such as SHA-1 or SHA-256), and it is included as part of the digital signature process. The SP uses the same digest algorithm to independently compare it with the received digest to validate the integrity of the received assertion or message.
Verification certificates
A verification certificate in authentik acts as the public key used to verify digital signatures on SAML responses and assertions from an SP. When a SAML message is received, authentik validates it by comparing the signature against its configured verification certificate, ensuring that messages originated from the SP.
Encryption certificates
An encryption certificate is a public key certificate used by authentik to encrypt sensitive data in SAML assertions before sending them to an SP. This ensures that sensitive data within the assertion, such as user attributes and authentication details, remain confidential and can only be decrypted by the SP possessing the corresponding private key.
When an encryption certificate is configured, authentik encrypts the assertion in an <EncryptedAssertion> element. If assertion signing is enabled and a signing certificate is configured, authentik signs the assertion before encrypting it. If response signing is enabled and a signing certificate is configured, authentik signs the response after encrypting the assertion. The SP must decrypt the assertion before verifying its signature.
Encryption algorithm:ak-version[2026.11]
The Encryption algorithm field under Advanced protocol settings specifies the algorithm that authentik uses to encrypt SAML assertions. This field is available only when an encryption certificate is configured.
| Encryption algorithm | XML Encryption identifier |
|---|---|
| AES128-CBC | http://www.w3.org/2001/04/xmlenc#aes128-cbc |
| AES256-CBC | http://www.w3.org/2001/04/xmlenc#aes256-cbc |
| AES128-GCM | http://www.w3.org/2009/xmlenc11#aes128-gcm |
| AES256-GCM (default) | http://www.w3.org/2009/xmlenc11#aes256-gcm |
AES256-GCM is the recommended algorithm and the default for new providers. The other algorithms provide compatibility with SPs that do not support AES256-GCM.
Providers created before authentik 2026.11 retain AES128-CBC to preserve compatibility. To use AES256-GCM with an existing provider, change its Encryption algorithm and verify that you can still log in to the SP.
Regardless of the selected algorithm, authentik encrypts the assertion's symmetric key with the encryption certificate's public key using RSA-OAEP (http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p).
When you import SP metadata, authentik reads the <EncryptionMethod> elements associated with the SP's encryption key. It selects the first supported algorithm in the SP's order of preference. If none of the listed algorithms are supported, or no algorithms are listed, authentik uses the default, AES256-GCM.
SAML property mappings
During a SAML authentication process, communication between the SP and the IdP relies on property mappings to align, or "map", user attributes values between the IdP and SP.
Each SAML property mapping includes the following fields:
- **Name**: The name of the property mapping that's displayed in the authentik admin interface.
- **SAML Attribute Name**: The label that maps IdP user information to SP expectations. Can be a URN OID, a schema reference, or any other string.
- **Friendly Name**: A human-friendly identifier for a SAML attribute.
- **Expression**: The Python expression that maps an authentik user attribute to a value that an SP is expecting.Default SAML property mappings
The following property mappings are automatically added when you create a new SAML provider and can be removed at will.
| Property Mapping Name | SAML Attribute Name |
|---|---|
| authentik default SAML Mapping: Email | http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress |
| authentik default SAML Mapping: Groups | http://schemas.xmlsoap.org/claims/Group |
| authentik default SAML Mapping: Name | http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name |
| authentik default SAML Mapping: UPN | http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn |
| authentik default SAML Mapping: User ID | http://schemas.goauthentik.io/2021/02/saml/uid |
| authentik default SAML Mapping: Username | http://schemas.goauthentik.io/2021/02/saml/username |
| authentik default SAML Mapping: WindowsAccountName (Username) | http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname |
The default SAML property mappings can be viewed on the Property Mappings page of the Admin interface by setting the Managed filter to All.
Custom SAML property mappings
If there is not already a property mapping that maps the user attributes that your SP requires, you can create a custom property mapping or edit one of the existing mappings.
For example, some SPs require users' first name (givenname) and last name (surname) attributes to be provided separately. However, the authentik default SAML Mapping: Name property mapping returns both attributes as one string. The following custom property mappings can be useful in such cases:
`surname`
SAML Attribute Name:
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surnameExpression:
pythonreturn request.user.name.rsplit(" ", 1)[-1]
`givenname`
SAML Attribute Name:
http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givennameExpression:
pythonreturn request.user.name.split(" ", 1)[0]
NameID
The NameID attribute acts as a unique identifier for a user. While other attributes might change (givenname, email address, etc) the NameID attribute is persistent and should never change. When the IdP sends a SAML assertion to the SP, the NameID is the unique identifier used to represent a specific user in the assertion. It's not used for authentication itself, only for identification purposes in the assertion.
NameID property mapping
In authentik, it's possible to configure which property mapping will be used to create the NameID value. The NameID Property Mapping field on a SAML provider can be set to any property mapping that's enabled on a SAML provider. When left empty, the NameID Policy of the incoming SP request will be respected.
Default NameID policy
In authentik, it's also possible to configure the default SAML NameID policy used for IDP-initiated logins or when an incoming SP assertion doesn't specify a NameID policy (also applies when using a custom NameID Mapping). The following table outlines how NameID policies are handled:
| Default NameID policy | How authentik will handle the NameID |
|---|---|
Persistent - urn:oasis:names:tc:SAML:2.0:nameid-format:persistent |
NameID will be set to the user's hashed ID. |
x509 Subject - urn:oasis:names:tc:SAML:2.0:nameid-format:X509SubjectName |
NameID will be set to the user's distinguishedName attribute. This attribute is set by the LDAP source by default. If the attribute does not exist, it will fall back to the persistent identifier. |
Windows - urn:oasis:names:tc:SAML:2.0:nameid-format:WindowsDomainQualifiedName |
NameID will be set to the user's UPN. This is also set by the LDAP source, and also falls back to the persistent identifier. |
Transient - urn:oasis:names:tc:SAML:2.0:nameid-format:transient |
NameID will be set based on the user's session ID. |
Email address - urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress |
NameID will be set to the user's email address. |
:::warning Email based NameID attribute
By default, users are free to change their email addresses. Therefore, it is recommended to either: avoid using a user's email address as the NameID attribute or, if possible, disallow changing email addresses.
:::
ForceAuthn:ak-version[2026.8]
An SP can set the ForceAuthn attribute on its AuthnRequest to require that the user authenticates again, even when they already have a valid authentik session.
authentik honors this attribute. When an incoming AuthnRequest sets ForceAuthn="true", the user is sent through the provider's authentication flow before the SSO flow continues. If the provider does not have an authentication flow configured, authentik uses the authentication flow configured for the associated brand. This behaves similarly to prompt=login for OAuth 2.0 and OpenID Connect providers. Once the user has re-authenticated, the SSO flow proceeds normally.
This requires no configuration on the provider, and it applies to any SP that sets the attribute. If users of an existing application are prompted to sign in again more often after upgrading to 2026.8, check whether that SP sets ForceAuthn.
AuthnContextClassRef
The AuthnContextClassRef attribute appears in the SAML assertion and contains a URI that describes the assurance level, such as password, multi-factor, or smartcard authentication. SPs use this information to understand and verify how the user was authenticated by an IdP.
In authentik, it's possible to set the AuthnContextClassRef attribute to any property mapping that's enabled on a SAML provider. This is done via the AuthnContextClassRef Property Mapping on a SAML provider.
Alternatively, when the AuthnContextClassRef Property Mapping field is left unpopulated on a SAML provider, the AuthnContextClassRef will be set based on the method that the user authenticated with.
Add Secure Apps Providers Scim Index (`website/docs/add-secure-apps/providers/scim/index.mdx`)
title: SCIM Provider sidebar_position: 11 sidebar_label: "SCIM Provider"
SCIM (System for Cross-domain Identity Management) is a set of APIs to provision users and groups. The SCIM provider in authentik supports SCIM 2.0 and can be used to provision and sync users from authentik into other applications.
A SCIM provider requires a SCIM base URL for the endpoint and an authentication token. SCIM works via HTTP requests, so authentik must be able to reach the specified endpoint. This endpoint usually ends in /v2, which corresponds to the SCIM version supported.
SCIM providers in authentik always serve as backchannel providers, which are used in addition to the main provider that supplies SSO authentication. A backchannel provider is used for an application that requires backend authentication, directory synchronization, or other additional authentication needs.
For instructions on creating a SCIM provider, refer to the Create a SCIM provider documentation.
Authentication modes
In authentik, there are three ways to authenticate SCIM requests:
- Static token provided by the application. This is the default authentication mode.
- Basic authentication, using a username and password provided by the application.
- OAuth token that authentik retrieves from a specified source and uses for authentication.
Static token
When the authentication mode is set to Static token, authentik sends the token provided by the application with outgoing SCIM requests to authenticate each request.
Basic
When the authentication mode is set to Basic, authentik sends the username and password provided by the application as an HTTP Basic Authorization header with each outgoing SCIM request. Use this mode for applications that do not accept a bearer token.
OAuth token :ak-enterprise {#oauth-token}
When you configure a SCIM provider to use OAuth for authentication, authentik generates short-lived tokens through an OAuth flow and sends them to the SCIM endpoint. This offers improved security and control compared with a static token.
authentik supports two types of SCIM OAuth authentication:
Silent OAuth – The system obtains or refreshes access tokens automatically, without any administrator interaction. This is the typical approach used for ongoing SCIM provisioning.
Interactive OAuth – During setup, an administrator is required to authorize the connection before the SCIM integration can obtain its initial token. authentik then stores a refresh token, and provisioning then runs in the background without further admin interaction.
You can also add additional token request parameters such as grant_type, subject_token, or client_assertion.
Example:
grant_type: client_credentialsgrant_type: password
:::info OAuth source required
To use OAuth authentication for your application, create and connect an OAuth source.
:::
Sync behavior
SCIM data is synchronized in two ways:
- When a user or group is created, modified, or deleted, that change is sent to all SCIM providers.
- Once an hour, all SCIM providers are fully synchronized.
The synchronization process runs in the authentik worker. To improve scalability, authentik starts a task for each batch of 100 users or groups, so the workload can be distributed across multiple workers.
Attribute mapping
Attribute mapping from authentik to SCIM users is done through property mappings, as with other providers. The default mappings for users and groups work for many setups, but you can define custom mappings to add fields.
All selected mappings are applied in the order of their name, and are deeply merged onto the final user data. The final data is then validated against the SCIM schema, and if the data is not valid, the sync is stopped.
:::warning Property mapping errors
Property mappings are evaluated in name order. If a property mapping fails to evaluate, authentik stops the synchronization and does not evaluate the remaining mappings.
:::
Custom attributes and schemas
To send attributes in a custom SCIM schema extension, create or edit a SCIM provider property mapping, then add it to the SCIM provider's User Property Mappings.
The property mapping must return both the extension schema URN in schemas and the object for that schema. For example, to send a standard work phone number and a custom github attribute from a user's authentik attributes, use the following code:
CUSTOM_SCHEMA = "urn:ietf:params:scim:schemas:extension:custom:2.0:User"
return {
"schemas": [CUSTOM_SCHEMA],
"phoneNumbers": [
{
"primary": True,
"value": request.user.attributes.get("phone", ""),
"type": "work",
}
],
CUSTOM_SCHEMA: {
"github": request.user.attributes.get("github", ""),
},
}Use the schema URN and field names expected by the target SCIM service. If the remote service supports only a fixed set of schemas or filters unknown attributes from responses, the attribute might not appear even when authentik sends it.
Skip objects during synchronization
To exclude specific users or groups from SCIM synchronization, you can create a property mapping that raises the SkipObject exception. When this exception is raised during the evaluation of a property mapping, the object is skipped and the sync continues with the next object.
For more information, refer to Skip objects during synchronization.
Filter the sync scope
You can limit which users and groups a SCIM provider synchronizes. User filtering and group filtering are configured separately.
User filtering
Users that are synchronized via a SCIM provider are controlled through application access policies. When a SCIM provider is configured as a backchannel provider for an application, only users who are bound to that application are synchronized. A common setup is to bind a group to the SCIM application so that all members of that group are synchronized to the target SCIM endpoint.
If no users are bound to the SCIM application, the SCIM provider synchronizes all users.
When a user is no longer assigned to the application—either directly or through a group—and a SCIM sync task runs, that user is deprovisioned from the target SCIM endpoint.
Use Exclude service accounts in the SCIM provider settings when you do not want service accounts to be synchronized.
Group filters
Group filters define the synchronization scope for groups. Group filters apply only to groups. They do not limit which users are synchronized.
If no group filters are selected, the SCIM provider synchronizes all groups.
If group filters are selected, only the selected groups are synchronized.
Changing the selected group filters does not remove groups or memberships that were synchronized previously.
Compatibility modes
Compatibility modes adjust authentik behavior for vendor-specific SCIM implementations.
Available compatibility modes are:
- Default: Standard SCIM 2.0 implementation
- AWS: Disables PATCH operations for AWS Identity Center compatibility
- Slack: Enables filtering support for Slack's SCIM implementation
- Salesforce: Uses the non-standard
/ServiceProviderConfigsendpoint - GitLab: Skips the
ServiceProviderConfigendpoint because GitLab's SCIM implementation does not expose it - Webex: Uses the vendor-specific behavior required for Webex SCIM
- vCenter: Skips the
ServiceProviderConfigendpoint, which is not implemented in VMware vCenter
To configure a compatibility mode, select the appropriate option in the SCIM Compatibility Mode field when creating or editing a SCIM provider.
Remote service capabilities
SCIM defines several optional settings that allow clients to discover a service provider's supported features. In authentik, the ServiceProviderConfig endpoint provides support for the following options (if the option is supported by the service provider).
:::note
The ServiceProviderConfig is cached for 1 hour after it is fetched. The cache is automatically cleared when the SCIM provider is updated (such as when changing the compatibility mode).
:::
Filtering
When the remote system supports filtering, authentik uses that operation to match remote users and groups to existing authentik users and groups.
Bulk
The
bulkconfiguration enables clients to send large collections of resource operations in a single request. If the remote system sets this attribute, authentik will respect themaxOperationsvalue to determine the maximum number of individual operations a server can process within a single bulk request.Patch updates
If the service provider supports PATCH updates, authentik will use patch requests to add/remove members of groups. For all other updates, such as user updates and other group updates, PUT requests are used.
Using in conjunction with other providers
Many applications support SCIM together with another SSO protocol such as OAuth/OIDC or SAML. With default settings, the unique user IDs in SCIM and other protocols are identical, which makes it easier for applications to link provisioned users with users who log in through SSO.
Applications can either match users on a unique ID sent by authentik called externalId, by their email or username.
OAuth/OIDC
The default provider configuration for the Subject mode option of Based on the User's hashed ID matches the externalId that's generated by default. If any other Subject mode is selected, the externalId attribute can be customized via SCIM mappings.
SAML
The SAML NameID policy urn:oasis:names:tc:SAML:2.0:nameid-format:persistent uses the same unique user identifier as the default externalId value used by the SCIM provider. If a SAML application does not send a NameID request, this value is also used as fallback.
Add Secure Apps Providers Single Logout Index (`website/docs/add-secure-apps/providers/single-logout/index.mdx`)
title: Single Logout (SLO) authentik_version: "2025.10.0" sidebar_position: 2 sidebar_label: "Single Logout"
Single Logout (SLO) is a security feature that logs users out of all active applications when they log out of authentik. It uses the OAuth2/OpenID Connect front-channel and back-channel logout specifications in combination with SAML's Single Logout specification.
For example, if a user is concurrently logged into an OIDC application and two SAML applications, when the user logs out of authentik, they will automatically be logged out of all three applications. Without SLO configured, users with active sessions across multiple applications would need to manually log out of each one.
:::info
Check with your service provider to see if they support SAML Single Logout or OIDC front-channel/back-channel logout. Not all service providers support these features.
:::
When Single Logout is triggered
Single Logout behavior depends on where the user initiates logout:
Logout from authentik: When a user logs out directly from authentik, the
default-invalidation-flowruns. This flow includes a User Logout stage that ends the user's authentik session and triggers Single Logout for all connected applications.Logout from an application: When a user logs out from an OIDC or SAML application, the invalidation flow that is selected on the provider runs. By default, this is the
default-provider-invalidation-flow, which does not include a User Logout stage, so only that application's session is ended while the user's authentik session and other application sessions remain active.
For instructions on how to enable full Single Logout when a user logs out from an application, see Choose the logout behavior for a provider below.
How Single Logout works in authentik
When a user logs out or their session is terminated in authentik, the following process occurs:
- Session Termination: The user's session ends through one of the following:
- User-initiated logout via a logout flow
- Administrative action (session deletion or user deactivation)
- Token revocation or expiration
- Provider Identification: authentik identifies all OAuth2/OIDC and SAML providers with active sessions for the users who have SLO configured.
- Logout Request Dispatch:
- Back-channel: HTTP POST requests are sent directly from the authentik server to each back-channel provider's configured logout endpoint.
- Front-channel: For user-initiated logouts, a logout stage is automatically injected into the flow that handles browser-based logout (typically via iframes or sequential redirects).
- Provider Processing: Each provider processes the logout request, validates it, and terminates the user's active session.
- Completion: After all providers have been notified, the user is redirected back to the authentik login screen.
Front-channel vs. back-channel logout
authentik supports both front-channel (browser-based) and back-channel (server-to-server) logout methods, depending on how each provider is configured.
Front-channel logout
Front-channel logout sends logout requests through the user's browser. authentik supports two front-channel modes:
iframe mode (default for OIDC)
- Loads all provider logout URLs simultaneously in hidden iframes
- Provides fast, parallel logout across multiple providers
- Required by the OIDC front-channel logout specification
- Most SAML providers also support iframe-based logout
Native Mode (SAML Only)
- Uses the active browser tab to chain redirects and POST requests sequentially
- Provides better compatibility with SAML providers that have iframe restrictions
- Each provider redirects the user back to authentik before proceeding to the next provider
- Not available for OIDC providers as the specification requires iframe support
:::info
Use native front-channel mode for SAML providers if you encounter iframe compatibility issues, such as Content Security Policy (CSP) restrictions or cookie handling problems.
:::
Back-channel Logout
Back-channel logout sends logout requests directly from the authentik server to each provider's logout endpoint via HTTP POST.
- Does not require user browser interaction
- Works even when the user is offline or their browser is closed
- Is automatically triggered by administrators terminating a user session (user deactivation or session deletion)
- Requires the provider to accept server-to-server POST requests
For SAML: Requires POST SLS binding.
For OIDC: Requires a logout_uri configured for back-channel that accepts logout tokens.
Choose the logout behavior for a provider
When a user logs out from an application, authentik runs the flow that is selected in the Invalidation Flow field of that application's provider. The flow that you select determines whether only the application session ends, or whether the user is also logged out of authentik and all other applications.
authentik includes two default invalidation flows that you can select for each provider:
| Invalidation flow | Behavior when the user logs out from the application |
|---|---|
default-provider-invalidation-flow |
Only the session of that application ends. The user's authentik session and their sessions in other applications remain active. This flow is selected by default for new providers. |
default-invalidation-flow |
Full Single Logout. The flow includes a User Logout stage, which ends the user's authentik session and logs them out of all applications. |
To choose the logout behavior for a provider, follow these steps:
- Log in to authentik as an administrator and open the authentik Admin interface.
- Navigate to Applications > Providers.
- Click the Edit icon of the provider that you want to configure.
- Under Advanced flow settings, select a flow in the Invalidation Flow field:
- To only end the application session, select
default-provider-invalidation-flow. - To enable full Single Logout, select
default-invalidation-flow.
- To only end the application session, select
- Click Update.
Because the flow is selected per provider, you can enable full Single Logout only for sensitive applications and keep the default behavior for others.
Enable Single Logout
Enabling single logout requires configuring logout endpoints on your SAML or OIDC providers in authentik.
SAML Providers
See the SAML Single Logout documentation for detailed instructions. You will need to:
- Configure the SLS URL (Single Logout Service URL) - the provider's logout endpoint
- Select the SLS Binding (Redirect or POST)
- Choose a Logout Method; front-channel iframe, front-channel native, or back-channel
- Optionally, enable Sign Logout Request for additional security
OIDC providers
See the OIDC Front-channel and Back-channel logout documentation for detailed instructions. You will need to:
- Configure the Logout URI - the provider's logout endpoint
- Enable the desired Logout Method; front-channel or back-channel
- Optionally configure logout token signing for back-channel requests
Single Logout for proxy providers and outposts
Proxy providers support Single Logout without any additional configuration. A proxy provider has no Logout URI or Logout Method setting, because the application's session is managed by the outpost and authentik notifies the outpost directly.
LDAP and RAC outposts also receive a notification when an authentik session ends. RADIUS outposts do not act on it.
Logout from authentik
When a user's authentik session ends, authentik notifies all connected outposts. Each proxy outpost then deletes the proxy sessions that were created from that authentik session. The next time that the user accesses the application, the outpost redirects them to authentik to log in again.
Outposts are notified when the authentik session ends for any of the following reasons:
- The user logs out via a logout flow.
- An administrator deletes the session or deactivates the user.
- The session expires.
Only proxy sessions that were created from the ended authentik session are deleted. Proxy sessions that the same user created from another browser or device remain active.
:::info
Outposts are notified asynchronously, and only outposts that are connected to authentik receive the notification. If an outpost is not connected to the authentik server when the authentik session ends, its proxy sessions remain valid until they expire. The lifetime of a proxy session is defined by the Token validity setting of the proxy provider.
:::
Logout from a proxied application
To log out of an application that is protected by a proxy provider, the user navigates to <authentik FQDN>/outpost.goauthentik.io/sign_out. For the host to use in each proxy mode, see Log out.
The outpost deletes all proxy sessions for that user within the outpost, and then redirects the user to authentik, where the invalidation flow of the provider runs. By default, the user's authentik session and their sessions in other applications remain active. To also end those sessions, see Choose the logout behavior for a provider.
LDAP providers
LDAP outposts receive the same notification when an authentik session ends. Each LDAP bind that runs the bind flow creates its own authentik session for the user, which is listed on the user's Sessions tab. When that session ends, the outpost closes the LDAP connection that the bind created, and the client must reconnect and bind again.
The session of an LDAP bind ends for the following reasons:
- An administrator deletes the session or deactivates the user.
- The session expires.
Logging out of authentik in a browser does not affect LDAP connections, because the browser session is separate from the session that the bind created.
:::info
Connections are only closed in the Direct bind mode. In the Cached bind mode, binds that are served from the cache of the outpost do not create an authentik session and are not reliably closed when a session ends.
:::
RAC providers
Connections to a RAC provider also end when the user's authentik session ends. For more information, see Connection and session expiry.
Session tracking
authentik tracks provider sessions to enable single logout:
- SAML: Creates
SAMLSessionrecords containing theSessionIndex,NameID, andNameID formatfor each successful authentication. - OIDC: Tracks session identifiers (
sid) and ID tokens required for logout requests.
These session records are automatically created during authentication and deleted after logout or expiration.
Administrative session termination
Back-channel logout is always triggered when a user session is terminated via administrative actions:
- Session Deletion: When an administrator manually deletes a user's session through the Admin interface or API, authentik sends back-channel logout requests to all configured providers.
- User Deactivation: When a user account is deactivated, authentik automatically sends back-channel logout requests to terminate all active sessions across all providers.
These requests are processed asynchronously to avoid blocking administrative operations.
Resources
- SAML Single Logout
- OIDC Front-channel and Back-channel Logout
- Proxy provider logout
- User Logout Stage
- SAML Profiles 2.0 Specification
- OpenID Connect Front-Channel Logout 1.0
- OpenID Connect Back-Channel Logout 1.0
Add Secure Apps Providers Ssf Index (`website/docs/add-secure-apps/providers/ssf/index.mdx`)
title: Shared Signals Framework (SSF) Provider sidebar_label: "SSF Provider" authentik_enterprise: true tags: [Shared Signals Framework, SSF, Apple Business Manager, Apple School Manager] sidebar_position: 12
The Shared Signals Framework (SSF) provider allows you to integrate applications with the Shared Signals Framework protocol.
SSF is a common standard for sharing asynchronous real-time security signals and events across multiple applications and an identity provider. The framework is a collection of standards and communication processes, documented in a specification. SSF leverages the APIs of the application and the IdP, using privacy-protected and secure webhooks.
The authentik SSF provider allows OIDC applications to subscribe to certain types of security signals (which are then translated into SETs, or Security Event Tokens) that are captured by authentik (the IdP), and then the application can respond to each event. In this scenario, authentik acts as the transmitter and the application acts as the receiver of the events.
Events in authentik that are tracked via SSF include when an MFA device is added or removed, logouts, sessions being revoked by Admin or user clicking logout, or credentials changed.
Refer to our documentation to learn how to create a SSF provider.
Example use cases
One important use case for SSF is to integrate Apple Business Manager or any of the Apple device management platforms with authentik, so that users can enroll their Apple devices using their authentik credentials. When a user signs in with their email address, Apple redirects them to authentik for authentication. After authentication, Apple enrolls the user's device and grants access to Apple services.
Another use case for SSF is when an administrator wants to know when a user logs out of authentik, so that the user is then also automatically logged out of all other work-focused applications.
Another example use case is when an application uses SSF to subscribe to authorization events because the application needs to know if a user changed their password in authentik. If a user did change their password, then the application receives a POST request to write the fact that the password was changed.
Use the authentik SSF provider
The SSF provider serves as a backchannel provider. Backchannel providers are used to augment the functionality of the main provider for an application.
Therefore you still need to create a typical OIDC application/provider pair, and when creating the application, assign the SSF provider as a backchannel provider.
When an authentik administrator creates an SSF provider, they need to configure both the application (the receiver) and authentik (the IdP and the transmitter).
The application (the receiver)
Within the application, the administrator creates an SSF stream which lists all the signals that the application wants to subscribe to, and defines the audience (aud), which is the URL that identifies the stream. A stream is basically an API request to authentik, which asks for a POST of all events. How that request is sent varies from application to application. An application can also change or delete the stream.
authentik does not specify which events to subscribe to; instead the application defines which events they want to listen for.
authentik (the transmitter)
To configure authentik as a shared signals transmitter, the authentik administrator creates a new SSF provider, to serve as the backchannel provider for the application.
When creating the SSF provider you will need to select a signing key that is used to sign the Security Event Tokens (SET).
Optionally, you can specify an event retention time period, which determines how long events are stored for. If an event could not be sent correctly, and retries occur, the event's expiration is also increased by this duration.
:::note SET events
Be aware that the SET events are different events than those displayed in the authentik Admin interface under Events.
:::
Add Secure Apps Providers Wsfed Index (`website/docs/add-secure-apps/providers/wsfed/index.mdx`)
title: WS-Federation Provider sidebar_position: 13 sidebar_label: "WS-Federation Provider" authentik_enterprise: true
The WS-Federation provider is used to integrate with applications and service providers that use WS-Federation protocol. WS-Federation is an XML-based identity federation protocol that uses token exchange for federated Single Sign-On (SSO) and IdP authentication, specifically for Windows applications such as SharePoint.
There are similarities between WS-Federation and SAML protocols, but there are several key differences in terminology, most importantly:
- WS-Federation term: STS (Security Token Service)
- SAML term: IdP (Identity Provider)
SAML assertion support
The authentik WS-Federation provider supports SAML 2.0 assertions by default. Starting with authentik 2026.8, it also supports SAML 1.1 assertions. The assertion version determines the format of the security token carried by WS-Federation; the federation protocol remains WS-Federation.
To issue SAML 1.1 assertions, select SAML 1.1 in the SAML assertion version field under Advanced protocol settings when configuring a WS-Federation provider.
Microsoft Entra ID integration is supported using WS-Federation with SAML 1.1 assertions. For configuration instructions, follow the Microsoft 365 WS-Federation integration guide.
:::warning Passive authentication only
The authentik WS-Federation provider supports browser-based passive authentication. It does not provide WS-Trust active authentication or Metadata Exchange (MEX) endpoints. Clients must support browser-based authentication.
:::
Supported URL request parameters
The following URL request parameters are supported in the authentik WS-Federation provider:
wa: This is a required parameter that represents the action being requested, typicallywsignin1.0for signing in. The parameter's value tells the Security Token Service (STS) which operation to execute.wtrealm: The unique identifier (realm) of the Relying Party (RP) or application requesting the security token, for example, urn:my-app:rp. It defines the trust relationship between the RP and the Identity Provider (IdP) and indicates which application is initiating the WS-Federation request. This is a required query parameter that tells the Security Token Service (STS) which relying party the token is intended for.wreply: The target URL to which the Identity Provider (IdP) sends the WS-Federation response containing the security token. This URL is supplied by the Service Provider (SP). authentik verifies that the receivedwreplyparameter matches the URL configured by the administrator and stored in the database.wctx: A context value that is used to maintain state between the Relying Party (RP) and the Identity Provider (IdP) across redirects. It serves the same purpose as theRelayStateparameter in SAML. The RP includes this value in the authentication request, and the IdP returns it unchanged in the response, allowing the RP to validate and restore the original session or request context.
WS-Federation bindings and endpoints
Bindings define how an Identity Provider (IdP) and the WS-Federation STS (Security Token Service), or IdP in SAML terms, communicate; how messages are transported over network protocols, specifying transport (like HTTP), encoding, and security detail that allow WS-Federation to facilitate secure identity sharing across systems. Both the IdP and STS define various endpoints in their metadata, each associated with a specific WS-Federation binding.
| Endpoint | URL |
|---|---|
| SSO/SLO | /application/wsfed/ |
WS-Federation metadata
Using metadata ensures that WS-Federation single sign-on works reliably by exchanging and maintaining identity and connection information. WS-Federation metadata is an XML document that defines how IdPs and SPs securely interact for authentication. It includes information such as endpoints, bindings, certificates, and unique identifiers. The metadata is what you provide the application to configure it for authenticating with authentik.
You can export WS-Federation metadata from an authentik WS-Federation provider to an STS to automatically provide important endpoint and certificate information to the SP.
Certificates
The certificates used with WS-Federation to sign Request Security Token Response (RSTR), which contains the assertion, are the same certificates that are used by SAML.
For details, refer to our SAML certificates documentation.
WS-Federation property mappings
Property mappings are used during the authentication process to align, or "map", user attributes values between the SP and STS (Security Token Service), the latter being the equivalent of SAML's IdP.
The same property mappings that are used in WS-Federation are used in SAML. For details, refer to our SAML property mapping documentation.
Attributes for WS-Federation
WS-Federation and SAML also share the use of the NameID and the AuthnContextClassRef attributes.
Customize Interfaces Admin Index (`website/docs/customize/interfaces/admin/index.mdx`)
title: Customize the Admin interface sidebar_label: Admin interface
The Admin interface can be customized using attributes configured in Brands.
To add, remove, or modify attributes for a brand, log in to the Admin interface and navigate to System > Brands > Other global settings > Attributes.
Most attributes defined in a brand apply to both the User and Admin interfaces. However, any settings that are specific to only the Admin interface are explicitly noted as such below.
The following screenshot shows the syntax for setting several attributes for a brand: dark mode, a 3-column display of applications on the Application Dashboard page of the User interface, and hiding the API and Notifications drawers from the Admin interface toolbar.
Custom settings
The following settings for attributes are grouped by:
enabledFeaturessettings- General settings (used on both the Admin interface and the User interface)
- Admin interface only
import Enabledfeatureslist from "../_enabledfeatureslist.mdx";
import Generalattributes from "../_generalattributes.mdx";
Settings for the Admin interface only
The following settings can only be used to customize the Admin interface, not the User interface.
`settings.pagination.perPage`
How many items should be retrieved per page. Defaults to 20.
`settings.defaults.userPath`
Default user path which is used when opening the user list. Defaults to users.
import Global from "../_global/global.mdx";
Customize Interfaces Flow Index (`website/docs/customize/interfaces/flow/index.mdx`)
title: Customize a flow sidebar_label: Flow interface
Typically, settings for flows are defined as defaults in the Brand settings. However, it’s important to note that some flows are executed before the specific user is authenticated and thus before authentik can determine which user is viewing the flow (for example, the default-authentication-flow!). Consequently, using default settings for all flows ensures a more consistent user experience.
Two settings that you can configure per flow are the background image for the flow, and the layout.
Customize a flow's background image
You can define a:
- Default background image for all flows, set in the instance's brand
- A background image for one or more specific flows (overrides the default)
Set the layout for a flow
To define the layout for a flow, edit the flow and, under Appearance settings > Layout, select how the UI displays the flow when it is executed: with stacked elements, content on the left or right, and the sidebar on the left or right.
Customize Interfaces User Index (`website/docs/customize/interfaces/user/index.mdx`)
title: Customize the User interface sidebar_label: User interface
The User interface can be customized using attributes configured in Brands.
To add, remove, or modify attributes for a brand, log in as an administrator and navigate to System > Brands > Other global settings > Attributes.
Most attributes defined in a brand apply to both the User and Admin interfaces. However, any settings that are specific to only one interface are explicitly noted as such below.
The following screenshot shows the syntax for setting several attributes for a brand: light mode, a 3-column display of applications on the Application Dashboard page, hiding the API drawer and the Notification drawer from the toolbar, and disallowing users to edit applications on the Application Dashboard page.
Custom settings
The following settings for attributes are grouped by:
enabledFeaturessettings- General attributes (used on both the Admin interface and the User interface)
- User interface only
import Enabledfeatureslist from "../_enabledfeatureslist.mdx";
`settings.enabledFeatures.applicationEdit` (User interface only)
Display the Edit option for each application on the Application Dashboard page (only shown when the user is a superuser).
`settings.enabledFeatures.requests` :ak-enterprise (User interface only)
When configured, show the requests tab on the user interface to allow users to request access to applications.
import Generalattributes from "../_generalattributes.mdx";
Settings for the User interface only
`settings.layout.type`
Which layout to use for the Application Dashboard page. Defaults to row. Choices: row, 2-column, 3-column
import Global from "../_global/global.mdx";
Customize Policies Types Index (`website/docs/customize/policies/types/index.mdx`)
title: Types of policies in authentik
tags:
- policy
- reference
- security
import DocCardList from "@theme/DocCardList";
These pages describe the built-in policy objects you can create in authentik.
Use this section to browse the dedicated reference page for each policy type.
Developer Docs Docs Templates Index (`website/docs/developer-docs/docs/templates/index.mdx`)
title: "Templates"
In technical documentation, there are document "types" (similar to how there are data types). We have templates for the different types, to make it super-easy to divide longer topics into separate pages (one for each content type) if needed. And templates in general make it easy for whomever wants to contribute some documentation!
The most common types are:
Combo: For most topics (unless they are very large and complex), we can combine the procedural and conceptual information into a single document. A handy guideline to follow is: "If the actual 1., 2., 3. steps are buried at the bottom, and a reader has to scroll multiple times to find them, then the combo approach is not the right one. Use separate topics.".
Procedural: these are How To docs, the HOW information, with step-by-step instructions for accomplishing a task. This is what most people are looking for when they open the docs... and best practice is to separate the procedural docs from long, lengthy conceptual or reference docs.
Conceptual: these docs provide the WHY information, and explain when to use a feature (or when not to!), and general concepts behind the feature or functionality.
Reference: this is typically tables or lists of reference information, such as configuration values, or functions, or most commonly APIs.
Add a new integration
To add documentation for a new integration (with support level Community or Vendor), please use the integration templates service.mdx from our GitHub repo. You can download the template using the following command:
wget https://raw.githubusercontent.com/goauthentik/authentik/main/website/integrations/template/service.mdxDeveloper Docs Docs Theming Index (`website/docs/developer-docs/docs/theming/index.mdx`)
title: Documentation Theming sidebar_label: Theming
import {
PaletteGroup,
ColorGroup,
} from "@goauthentik/docusaurus-theme/components/infima/Swatch/index.tsx";
import {
DispositionDangerColorEntries,
DispositionInfoColorEntries,
DispositionSuccessColorEntries,
DispositionWarningColorEntries,
InfimaColorsMap,
UtilityColorEntries,
} from "@goauthentik/docusaurus-theme/components/infima/constants.ts";
:::info Advanced
This section is intended for developers of authentik's documentation site. If you are looking to customize the theming of your own authentik instance, please refer to the branding documentation.
:::
The authentik documentation site is built using Meta's Docusaurus, which uses their internal Infima CSS framework for its styling and theming capabilities. Infima's own documentation is limited, possibly due to it's internal nature and Docusaurus being the primary consumer. This document aims to provide an overview of how theming is handled in the authentik documentation site, and how you can customize it.
Infima Color Palette
With the exception of a few customizations, our color palette is managed through Infima's theming system.
Primary
<ColorGroup group={InfimaColorsMap.get("primary")} />
Secondary
<ColorGroup group={InfimaColorsMap.get("secondary")} />
Success
<ColorGroup group={InfimaColorsMap.get("success")} />
Info
<ColorGroup group={InfimaColorsMap.get("info")} />
Warning
<ColorGroup group={InfimaColorsMap.get("warning")} />
Danger
<ColorGroup group={InfimaColorsMap.get("danger")} />
Utility & UI Colors
Dispositions
Info
Success
Warning
Danger
Endpoint Devices Authentik Agent Agent Deployment Index (`website/docs/endpoint-devices/authentik-agent/agent-deployment/index.mdx`)
title: Deployment sidebar_label: Deployment authentik_version: "2025.12.0"
import DocCardList from "@theme/DocCardList";
You can deploy the authentik Agent on Linux, macOS, and Windows devices.
Documentation for large-scale deployments using Mobile Device Management (MDM) and automated tools is also available.
Select a topic below to continue:
Endpoint Devices Authentik Agent Device Authentication Index (`website/docs/endpoint-devices/authentik-agent/device-authentication/index.mdx`)
title: Device authentication sidebar_label: Device authentication authentik_version: "2025.12.0"
import DocCardList from "@theme/DocCardList";
The authentik Agent supports multiple types of authentication and authorization using authentik credentials:
- Local device login - Log in to Windows endpoint devices.
- SSH authentication - Connect from one endpoint device to another via SSH.
- Authenticate CLI applications - Authenticate CLI based applications like
awsandkubectl.
Device access groups allow you to control which users have access to a device.
For more information, pick a topic below:
Endpoint Devices Authentik Agent Release Notes Index (`website/docs/endpoint-devices/authentik-agent/release-notes/index.mdx`)
title: authentik Agent Releases sidebar_label: Release Notes
import DocCardList from "@theme/DocCardList";
Release notes for recent authentik Agent versions
Endpoint Devices Device Compliance Connectors Index (`website/docs/endpoint-devices/device-compliance/connectors/index.mdx`)
title: Connectors sidebar_label: Connectors tags: [device compliance, compliance, connectors, authentik Agent, fleet, fleetdm] authentik_version: "2025.12.0"
Connectors allow device information to be reported to authentik. Connectors for third-party services like Fleet can be used standalone or alongside the authentik Agent connector.
Available connectors
The following connectors are currently available:
- authentik Agent connector: Integrates with the authentik Agent
- Fleet connector: Integrates with Fleet device management
Connectors are in development for Entra, Intune, Cloudflare WARP and other services.
Manage connectors
Use the following instructions to manage your connectors:
Add a connector
For more specific instructions on adding a connector refer to the authentik Agent connector or Fleet connector documentation.
- Log in to authentik as an administrator and open the authentik Admin interface.
- Navigate to Endpoint Devices > Connectors and click Create.
- Select the connector type, click Next, and configure the following required settings:
- Connector name: Provide a descriptive name for the connector.
- Refresh interval: Select how often the agent updates its configuration.
- Enabled: Enable or disable the connector.
- Click Finish.
Edit a connector
- Log in to authentik as an administrator and open the authentik Admin interface.
- Navigate to Endpoint Devices > Connectors.
- Click on the connector that you wish to edit.
- Update any settings that you want to change.
- Click Update.
Delete a connector
- Log in to authentik as an administrator and open the authentik Admin interface.
- Navigate to Endpoint Devices > Connectors.
- Select the connector that you wish to delete.
- Click Delete.
Sys Mgmt Ops Autoscaling Index (`website/docs/sys-mgmt/ops/autoscaling/index.mdx`)
title: Autoscaling on Kubernetes slug: /sys-mgmt/ops/autoscaling sidebar_label: Overview sidebar_position: 1
On Kubernetes, you can automatically adjust the number of authentik server and worker replicas independently:
- Scale servers on CPU usage with the Helm chart's Horizontal Pod Autoscaler (HPA). This requires Kubernetes resource metrics, but does not require KEDA or Prometheus.
- Scale workers on queued tasks with KEDA. Queue length can reveal a backlog even when workers use little CPU, such as when they wait for external services. The metric includes delayed tasks and excludes tasks already running.
Keep at least one worker running to handle scheduled tasks and file changes. For the number of tasks each replica can run concurrently, see Worker scaling.
Sys Mgmt Ops Storage S3 Index (`website/docs/sys-mgmt/ops/storage-s3/index.mdx`)
title: S3-compatible storage sidebar_label: Overview sidebar_position: 1
authentik can store uploaded files in Amazon S3 or an S3-compatible object storage service instead of storing them on the local filesystem in /data.
This guide covers the settings, permissions, and migration steps that are common to S3 storage. For service-specific endpoints and authentication details, see S3-compatible storage providers.
For the full list of storage configuration options, see the configuration reference.
Prepare storage
Before you configure authentik, create or identify the following values:
- An S3 bucket for authentik files, for example ``.
- S3 access credentials, unless you use AWS SDK authentication such as an instance role or profile.
- The S3 endpoint URL for your storage service, unless you use Amazon S3.
- The public origin that users use to access authentik, for example
https://authentik.company.
The examples on this page use the AWS CLI. For S3-compatible services, add the service endpoint with --endpoint-url=<s3_endpoint>.
Configure bucket permissions
authentik needs permission to list bucket contents and to read, write, and delete objects in the bucket. For Amazon S3, the following IAM policy grants those permissions:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ListBucket",
"Effect": "Allow",
"Action": ["s3:ListBucket"],
"Resource": "arn:aws:s3:::<bucket_name>"
},
{
"Sid": "ManageObjects",
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:PutObject",
"s3:DeleteObject",
"s3:AbortMultipartUpload",
"s3:ListMultipartUploadParts"
],
"Resource": "arn:aws:s3:::<bucket_name>/*"
}
]
}For other S3-compatible services, create an equivalent policy in the service's access-control system.
Configure CORS
Apply a cross-origin resource sharing (CORS) policy to the bucket so that the authentik web interface can load files directly from generated S3 URLs.
Save the following policy as cors.json. Replace https://authentik.company with your authentik origin, including the scheme and port if you use a non-standard port.
{
"CORSRules": [
{
"AllowedOrigins": ["https://authentik.company"],
"AllowedHeaders": ["Authorization"],
"AllowedMethods": ["GET"],
"MaxAgeSeconds": 3000
}
]
}If users access authentik from more than one domain, include each origin in AllowedOrigins.
Apply the policy:
AWS_ACCESS_KEY_ID=<access_key> AWS_SECRET_ACCESS_KEY=<secret_key> aws s3api \
--endpoint-url=<s3_endpoint> \
put-bucket-cors \
--bucket=<bucket_name> \
--cors-configuration=file://cors.jsonFor Amazon S3, omit --endpoint-url.
Configure authentik
Add the following settings to your .env file:
AUTHENTIK_STORAGE__BACKEND=s3
AUTHENTIK_STORAGE__S3__ACCESS_KEY=<access_key>
AUTHENTIK_STORAGE__S3__SECRET_KEY=<secret_key>
AUTHENTIK_STORAGE__S3__BUCKET_NAME=<bucket_name>If you use AWS SDK authentication, such as an instance role or profile, omit AUTHENTIK_STORAGE__S3__ACCESS_KEY and AUTHENTIK_STORAGE__S3__SECRET_KEY. See AUTHENTIK_STORAGE__S3__SESSION_PROFILE and related options in the configuration reference.
For other S3-compatible services, also configure the service endpoint:
AUTHENTIK_STORAGE__S3__ENDPOINT=<s3_endpoint>The provider reference lists service-specific endpoint and region values.
Configure a public S3 hostname
Set AUTHENTIK_STORAGE__S3__CUSTOM_DOMAIN only when the hostname that authentik uses to reach S3 is different from the hostname that browsers use to retrieve files.
AUTHENTIK_STORAGE__S3__CUSTOM_DOMAIN=<public_s3_domain>/<bucket_name>The custom domain must include the bucket name and must not include a scheme. For example, if users retrieve objects from https://s3.company/authentik-data/, set:
AUTHENTIK_STORAGE__S3__CUSTOM_DOMAIN=s3.company/authentik-dataAUTHENTIK_STORAGE__S3__SECURE_URLS controls whether generated file URLs use HTTPS and defaults to true.
Configure compatibility options
If your storage service requires path-style bucket addressing, set:
AUTHENTIK_STORAGE__S3__ADDRESSING_STYLE=pathIf your storage service supports only legacy S3 signatures, set:
AUTHENTIK_STORAGE__S3__SIGNATURE_VERSION=s3The default signature version is s3v4.
For local HTTP testing, set AUTHENTIK_STORAGE__S3__SECURE_URLS=false. Use HTTPS for production deployments.
Check file content types
Browsers rely on the HTTP Content-Type header to decide whether to render a file as an image, HTML, or another format. authentik sets the content type when it uploads files. If you upload files to the bucket with another tool, ensure that the tool also writes the correct Content-Type metadata.
The following command updates the Content-Type metadata for PNG files in a bucket:
aws s3 cp \
s3://<bucket_name>/ s3://<bucket_name>/ \
--exclude "*" --include "*.png" \
--no-guess-mime-type \
--content-type "image/png" \
--metadata-directive "REPLACE" \
--recursive:::info
Terraform uploads to S3 do not set the Content-Type header unless you configure the metadata explicitly.
:::
Migrate between storage backends
The following examples assume that the local storage path is /data and the bucket is ``. Ensure that your AWS CLI configuration can reach your storage service. For services other than Amazon S3, include --endpoint-url=<s3_endpoint>.
Migrate from file storage to S3
Follow the setup steps above, then sync files from the local directory to the bucket root:
aws s3 sync /data s3://<bucket_name>/For services other than Amazon S3:
aws --endpoint-url=<s3_endpoint> s3 sync /data s3://<bucket_name>/Migrate from S3 to file storage
aws s3 sync s3://<bucket_name>/ /dataFor services other than Amazon S3:
aws --endpoint-url=<s3_endpoint> s3 sync s3://<bucket_name>/ /dataUsers Sources Sources Property Mappings Index (`website/docs/users-sources/sources/property-mappings/index.mdx`)
title: Source property mappings
Source property mappings allow you to modify or gather extra information from sources.
This page is an overview of how property mappings work. For information about a specific protocol, refer to the protocol page:
Create a custom source property mapping
If the default source mappings are not enough, or if you need to get additional data from the source, you can create your own custom source property mappings.
Here are the steps:
- In authentik, open the Admin interface, and then navigate to Customization > Property Mappings.
- Click Create, select the property mapping type for your source, and then click Next.
- Type a unique and meaningful Name, such as
ldap-displayName-mapping:name. - In the Expression field, enter Python expressions to retrieve the value from the source. See Expression semantics below for details.
- In the source configuration, select the newly created property mapping as a User property mapping if it applies to users, or Group property mapping if it applies to groups.
How it works
Expression semantics
Each source provides the Python expression with additional data. You can import parts of that data into authentik users and groups. Assuming the source provides us with a data Python dictionary, you can write the following:
return {
"name": data.get("displayName"),
}You can see that the expression returns a Python dictionary. The dictionary keys must match User properties or Group properties. Note that group_attributes cannot be set for users. A user property mapping can return groups, which feeds group synchronization rather than setting a property on the user.
See each source documentation for a reference of the available data. See the authentik expressions documentation for available data and functions.
Note that the list_flatten method is applied for all top-level properties, but not for attributes:
return {
"username": data.get("username"), # list_flatten is automatically applied to top-level attributes
"attributes": {
"phone": list_flatten(data.get("phoneNumber")), # but not for attributes!
},
}Object construction process
A user or group object is constructed as follows:
- The source provides initial properties based on commonly used data.
- Each property mapping associated with the source is run and results are merged into the previous properties.
- If a property mapping throws an error, the process is aborted. If that happens inside a synchronization process, the object is skipped. If it happens during an enrollment or authentication flow, the flow is canceled.
- If a property mapping sets one attribute to
None, that attribute is then discarded.
- If the
usernamefield is not set for user objects, or thenamefield is not set for group objects, the process is aborted. - The object is created or updated. The
attributesproperty is merged with existing data if the object already exists.
Group synchronization
LDAP and SCIM sources have built-in mechanisms to get groups. This section does not apply to them.
You can write a custom property mapping to set the user's groups:
return {
"groups": data.get("groups", []),
}The groups attribute is a special attribute that must contain group identifiers. By default, those identifiers are also used as the group name. Each identifier is then given to group property mappings as the group_id variable, if extra processing needs to happen.
An identifier has to be a simple value such as a string. Entries that are not, such as the objects some identity providers return in an OpenID Connect groups claim, are skipped, and a Configuration error event records how many were dropped.
Disabling group synchronization
The source collects its groups before any property mapping runs, and mapping results are merged into them as described in Object construction process. To prevent the collected groups from being imported, return None for the groups attribute:
return {"groups": None}This stops groups from being imported. However, authentik reconciles source-linked memberships on every login, so users are still removed from groups that were created by or linked through the source.
Object-shaped OpenID Connect group claims
OpenID Connect does not define a groups claim, so providers are free to put anything in one. Some return group objects instead of plain identifiers.
The best fix is on the provider side. Configure it to return an array of stable, unique identifiers:
{
"groups": ["g1", "g2"]
}Prefer an immutable group ID from the provider. Only use a display name if it is unique and never changes.
If the provider cannot do that, create an OAuth source property mapping and attach it to the source's User property mappings. These mappings receive the provider's response in the info variable.
The mapping below handles a groups claim holding identifiers, objects, or a mix of both:
groups = []
for group in info.get("groups", []):
if isinstance(group, dict):
# Adjust these keys for your provider. Some use "id",
# SCIM group resources use "value".
group_id = group.get("value") or group.get("id")
else:
group_id = group
if isinstance(group_id, (str, int)):
groups.append(group_id)
return {"groups": groups}Pick a stable, unique identifier from each object, because authentik uses it to recognize the group on later logins.
The identifiers the mapping returns are merged into the groups the source already collected, not substituted for them, so the original objects are still in the list. authentik skips those and records a Configuration error event counting how many it dropped. The identifiers you extracted still synchronize.
To get rid of the event, the groups claim itself has to contain only identifiers. Either change what the provider sends, or have it emit a separate identifier-only claim and map that claim to groups.
To use the provider's group name instead of the identifier, add a second OAuth source property mapping under the source's Group property mappings. It receives group_id along with the original info data:
for group in info.get("groups", []):
if not isinstance(group, dict):
continue
# Use the same identifier keys as the user property mapping.
if (group.get("value") or group.get("id")) != group_id:
continue
# Adjust these keys for your provider.
group_name = group.get("display") or group.get("name")
if group_name:
return {"name": group_name}
break
return {"name": str(group_id)}Skip this second mapping if the identifier already makes a reasonable group name.
Users Sources Sources Social Logins Index (`website/docs/users-sources/sources/social-logins/index.mdx`)
title: Federated identity providers sidebar_label: Identity providers tags: [saml, oauth]
Configuring authentik with a federated identity provider allows users to authenticate with their existing credentials, such as social logins or enterprise identity providers.
Typically, identity providers use protocols such as OAuth 2.0 or Security Assertion Markup Language (SAML). These protocols allow authentik to act as a service provider (SP), delegating the authentication process to the identity provider (IdP). The choice of protocol depends on the provider and the level of integration desired.
IdP-initiated single sign-on
In this scenario, a user is logged in to the IdP and attempts to access a resource on a remote SP server. In this example, the IdP is Google, Facebook, or another social login provider. The SP is authentik, acting as a service provider.
sequenceDiagram
autonumber
participant User
participant IdP as Identity Provider
participant SP as authentik
participant Browser
User->>IdP: Log in
User->>SP: Access resource
SP->>IdP: Request SAML assertion
IdP->>IdP: Authenticate user
IdP->>SP: Return SAML assertion
SP->>Browser: Redirect to resourceIn short, the user logs in to the IdP, requests access to a resource on the SP, and is redirected to the SP with a SAML assertion. The SP validates the assertion and establishes a session for the user.
SP-initiated single sign-on
In this scenario, a user attempts to access a protected resource directly on an SP website without being logged in. The user does not have an account on the SP site, but does have a federated account managed by a third-party IdP. The SP sends an authentication request to the IdP. Both the request and the returned SAML assertion are sent through the user's browser via HTTP POST.
sequenceDiagram
autonumber
participant User
participant IdP as Identity Provider
participant SP as authentik
participant Browser
User->>SP: Access resource
SP->>IdP: Request SAML assertion
IdP->>IdP: Authenticate user
IdP->>SP: Return SAML assertion
SP->>Browser: Redirect to resourceIn short, the user requests access to a resource on the SP, the SP requests a SAML assertion from the IdP, the IdP authenticates the user and returns a SAML assertion, and the SP establishes a session for the user.
Configure authentik
While we provide detailed guides for popular services such as Google, GitHub, and Microsoft Entra ID, you can configure any standards-compliant provider using the same basic process.
authentik supports most identity providers that implement standard OAuth 2.0 or SAML 2.0 protocols. While each provider may have its own administrative interface, the core information needed is consistent, typically OAuth client credentials or SAML metadata.
Our provider-specific guides walk you through any unique steps needed for each service.
See also
External references
Users Sources User Account Types Index (`website/docs/users-sources/user/account-types/index.mdx`)
title: Account types sidebar_position: 2
authentik supports several account types that represent people and machine identities. The account type determines how an account is created, how it authenticates, and how it is used.
The available account types are:
- Internal users: human users whose accounts are created and managed in authentik.
- External users: human users who typically authenticate to a single application and cannot access the authentik application dashboard.
- Service accounts: non-human identities created by an administrator for integrations and automation.
- Internal service accounts: non-human identities created and managed by authentik for internal components. They can not be created by administrators.
- Agent accounts: non-human identities that act on behalf of a parent user.
Choose an account type
Use the following table to choose an account type:
| Requirement | Account type |
|---|---|
| A user that needs access to the application dashboard | Internal user |
| A user that does not need access to the application dashboard | External user |
| An administrator needs a machine identity for an integration or automation | Service account |
| An integration needs to act on behalf of a specific user | Agent account |
Add Secure Apps Flows Stages Flow Context Index (`website/docs/add-secure-apps/flows-stages/flow/context/index.mdx`)
title: Flow Context toc_max_heading_level: 5
Each flow execution has an independent context. This context holds all of the arbitrary data about that specific flow, data which can then be used and transformed by stages and policies.
Manage data in a flow context
You create and manage the data for a context by configuring policies, stages, and bindings. As you plan your flow, and set up the required stages, etc. you are creating the context data for that flow.
For example, in the Identification Stage (part of the default login flow), you can define whether users will be prompted to enter an email address, a username, or both. All such information about the flow's configuration makes up the context.
Any data can be stored in the flow context, however there are some reserved keys in the context dictionary that are used by authentik stages.
To manage flow context on a more granular level, see Setting flow context keys.
Context dictionary and reserved keys
This section describes the data (the context) that are used in authentik, and provides a list of keys, what they are used for and when they are set.
:::warning
Keys prefixed with goauthentik.io are used internally by authentik and are subject to change without notice, and should not be modified in policies in most cases.
:::
{/* To update this file, search for PLAN_CONTEXT_\w+\s= in the workspace to find all definitions. */}
Common keys
`pending_user` ([User object](../../../../users-sources/user/user_ref.mdx#object-properties))
pending_user is used by multiple stages. In the context of most flow executions, it represents the data of the user that is executing the flow. This value is not set automatically, it is set via the Identification stage.
Stages that require a user, such as the Password stage, the Authenticator validation stage, and others will use this value if it is set, and fall back to the request's user when possible.
`prompt_data` (Dictionary)
prompt_data is primarily used by the Prompt stage. The value of any field within a prompt stage is written to the prompt_data dictionary. For example, given a field with the Field key email that was submitted with the value [email protected] will result in the following context:
{
"prompt_data": {
"email": "[email protected]"
}
}Policies can change this data. Stages such as User Write can then store values from prompt_data on pending_user.
For more information, see Collect custom user attributes during enrollment.
`redirect` (string)
Stores the final redirect URL that the user's browser will be sent to after the flow is finished executing successfully. This is set when an un-authenticated user attempts to access a secured application, and when a user authenticates/enrolls with an external source.
`pending_user_identifier` (string)
If Show matched user is disabled, this key will hold the user identifier entered by the user in the identification stage.
`application` (Application object)
When an unauthenticated user attempts to access a secured resource, they are redirected to an authentication flow. The application they attempted to access will be stored in the key attached to this object. For example: application.github, with application being the key and github the value.
`source` (Source object)
When a user authenticates/enrolls via an external source, this will be set to the source they are using.
`outpost` (dictionary)
When a flow is executed by an Outpost (for example the LDAP or RADIUS), this will be set to a dictionary containing the Outpost instance under the key "instance".
Scenario-specific keys
`is_sso` (boolean)
This key is set to True when the flow is executed from an "SSO" context. For example, this is set when a flow is used during the authentication or enrollment via an external source, and if a flow is executed to authorize access to an application.
`is_restored` (Token object)
This key is set when a flow execution is continued from a token. This happens for example when an Email stage is used and the user clicks on the link within the email. The token object contains the key that was used to restore the flow execution. This field is also used by the Source stage when returning back to the initial flow the Source stage was run on.
`is_redirected` (Flow object)
This key is set when the current flow was reached through a Redirect stage in Flow mode.
Stage-specific keys
Autosubmit stage
The autosubmit stage is an internal stage type that is not configurable via the API/Web interface. It is used in certain situations, where a POST request is sent from the browser, such as with SAML POST bindings. This works by using an HTML form that is submitted automatically.
`title` (string)
Optional title of the form shown to the user. Automatically set when this stage is used by the backend.
`url` (string)
URL that the form will be submitted to.
`attrs` (dictionary)
Key-value pairs of the data that is included in the form and will be submitted to url.
Captcha stage:ak-version
`captcha` (dictionary)
When Error on invalid score is set to false on a captcha stage, after the execution of the captcha stage, this object will be set in the flow context.
It contains two keys, response which is the raw response from the specified captcha verification URL, and stage, which is a reference to the captcha stage that executed the test.
`goauthentik.io/stages/captcha/site_key` (string):ak-version[2025.12]
`goauthentik.io/stages/captcha/private_key` (string):ak-version[2025.12]
Optionally set captcha site and private keys dynamically through a policy, for example when using E2E testing with a captcha stage bound.
Consent stage
`consent_header` (string)
The title of the consent prompt shown. Set automatically when the consent stage is used with an OAuth2, Proxy or SAML provider.
`consent_permissions` (List of PermissionDict)
An optional list of all permissions that will be given to the application by granting consent. Not supported with SAML. When used with an OAuth2 or Proxy provider, this will be set based on the configured scopes.
Deny stage
`deny_message` (string)
Optionally overwrite the deny message shown, has a higher priority than the message configured in the stage.
User write stage
`groups` (List of [Group objects](../../../../users-sources/groups/index.mdx))
See Group. If set in the flow context, the pending_user will be added to all the groups in this list.
If set, this must be a list of group objects and not group names.
`user_path` (string)
Path the pending_user will be written to. If not set in the flow, falls back to the value set in the user_write stage, and otherwise to the users path.
`user_type` (string)
Type the pending_user will be created as. Must be one of internal, external or service_account.
Password stage
`user_backend` (string)
Set by the Password stage after successfully authenticating the user. Contains a dot-notation to the authentication backend that was used to successfully authenticate the user.
`auth_method` (string)
Set by the Password stage, the Authenticator validation stage, the OAuth2 Provider, and the API authentication depending on which method was used to authenticate.
Possible options:
password(Authenticated via the password in authentik's database)token(Authenticated via API token)ldap(Authenticated via LDAP bind from an LDAP source)auth_mfa(Authentication via MFA device without password)auth_webauthn_pwl(Passwordless authentication via WebAuthn with Passkeys)jwt(M2M authentication via an existing JWT)mtls(Authentication via Certificate, see Mutual TLS Stage)
`auth_method_args` (dictionary)
Additional arguments used during the authentication. Value varies depending on auth_method.
Example:
{
// List of the MFA device objects used during authentication
// applies for `auth_method` `auth_mfa`
"mfa_devices": [],
// MFA device used for passwordless authentication, applies to
// `auth_method` `auth_webauthn_pwl`
"device": null,
// the token identifier when `auth_method` `token` was used
"identifier": "",
// JWT information when `auth_method` `jwt` was used
"jwt": {},
"source": null,
"provider": null,
// Certificate used for authentication
// applies for `auth_method` `mtls`
"certificate": {}
}Email stage
`email_sent` (boolean)
Boolean set to true after the email from the email stage has been sent.
`email` (string)
Optionally override the email address that the email will be sent to. If not set, defaults to the email of pending_user.
Identification stage
`pending_user_identifier` (string)
If Show matched user is disabled, this key will be set to the user identifier entered by the user in the identification stage.
Invitation stage
`invitation` (Invitation object)
The invitation used with the invitation stage. When Continue flow without invitation is enabled, this may be unset.
If the invitation was single-use, this object may hold a reference to an invitation that no longer exists in the database.
`invitation_in_effect` (boolean)
A boolean value that is True when an invitation has been used.
`token` (string)
This value can be set either via Prompt data or via policy to interactively/programmatically choose an invitation.
Redirect stage
`redirect_stage_target` (string)
Set this key in an Expression Policy to override Redirect stage to force it to redirect to a certain URL or flow. This is useful when a flow requires that the redirection target be decided dynamically.
Use the format ak-flow://{slug} to use the Redirect stage in Flow mode. Any other format will result in the Redirect stage running in Static mode.
Mutual TLS Stage
`certificate` (dictionary):ak-version[2025.6]
This key is set by the Mutual TLS Stage during authentication and enrollment and contains data about the certificate supplied by the browser.
Starting with authentik 2026.11, the san key contains the certificate's Subject Alternative Names, grouped by type (for example DNSName, RFC822Name, IPAddress, or UniformResourceIdentifier). Only types present in the certificate are included.
Example:
{
"serial_number": "1234",
"subject": "CN=client",
"issuer": "CN=authentik Test CA, O=authentik, OU=Self-signed",
"fingerprint_sha256": "08:D4:A4:79:25:CA:C3:51:28:88:BB:30:C2:96:C3:44:5A:EB:18:07:84:CA:B4:75:27:74:61:19:8A:6A:AF:FC",
"fingerprint_sha1": "5D:14:0D:5F:A2:7E:14:B0:F1:1D:6F:CD:E3:4B:81:68:71:24:1A:70",
"san": {
"DNSName": ["client.example.com"],
"RFC822Name": ["[email protected]"]
}
}For example, to read the first email address from the certificate in an expression policy:
emails = context["flow_plan"].context["certificate"]["san"].get("RFC822Name", [])
return emails[0] if emails else NoneAdd Secure Apps Flows Stages Stages Account Lockdown Index (`website/docs/add-secure-apps/flows-stages/stages/account_lockdown/index.mdx`)
title: Account Lockdown stage authentik_version: "2026.5.0" authentik_enterprise: true
:::danger
This stage performs destructive actions on a user account. Ensure the flow includes appropriate warnings and confirmation steps before this stage executes.
:::
The Account Lockdown stage executes security lockdown actions on a target user account. For the feature overview and usage instructions, see Account Lockdown.
Stage behavior
- Resolves the target account from the flow query parameters (see Target user resolution)
- Applies the configured actions to that account
- Creates an event for the locked account
- For self-service: if sessions are deleted, redirects to the completion flow
Stage settings
| Setting | Description | Default |
|---|---|---|
| Deactivate user | Set is_active to False |
Enabled |
| Set unusable password | Invalidate the local authentik password. External source passwords are not changed. | Enabled |
| Delete sessions | Terminate all active sessions | Enabled |
| Revoke tokens | Delete all tokens and grants (API, app password, recovery, verification, OAuth) | Enabled |
| Completion flow | Flow for self-service completion (must not require auth) | None |
:::warning
Disabling Delete sessions is not recommended as it would allow an attacker with an active session to continue using the account.
:::
Target user resolution
The account lockdown API pre-plans the flow with the selected user as the flow's pending_user. The stage uses that pending_user as the account to lock.
The resolved target must be:
- a real user account
- not the anonymous user
- not an internal service account
If no valid target user can be resolved, the stage returns an invalid response.
Reason input
The stage reads the lockdown reason from:
prompt_data.lockdown_reasonlockdown_reasonin the flow plan context- an empty string if neither is set
Self-service behavior
When the resolved target user is the same user who is currently authenticated and Delete sessions is enabled, the user's session is deleted during lockdown. The stage cannot continue to the next stage, so it redirects to the Completion flow.
If Delete sessions is disabled, the flow continues normally and can show its own completion stages.
The completion flow must have Authentication set to No authentication required.
Events
Creates a User Write event with an account-lockdown action ID. Use Notification Rules to send alerts. To match account-lockdown events, use action user_write and query context.action_id = "account_lockdown".
{
"action": "user_write",
"context": {
"action_id": "account_lockdown",
"reason": "User-provided reason",
"affected_user": "username"
}
}Usage examples
Policy to show a completion stage only for administrator-triggered lockdowns
target_user = request.context.get("pending_user")
current_user = request.http_request.user
return bool(target_user and current_user and target_user.pk != current_user.pk)Dynamic warning message
Prompt field with Initial value expression enabled:
target = user
current_user = http_request.user
is_self_service = bool(target and current_user and target.pk == current_user.pk)
from django.utils.html import escape
if is_self_service:
return """<p><strong>This will immediately:</strong></p>
<ul>
<li>Invalidate your local authentik password</li>
<li>Deactivate your account</li>
<li>Terminate all sessions</li>
<li>Revoke all tokens</li>
</ul>"""
else:
if target:
return f"<p><strong>Locking down:</strong></p><p><code>{escape(target.username)}</code></p>"
return "<p><strong>Locking down the selected account.</strong></p>"Error handling
| Error | Cause |
|---|---|
| "No target user specified" | No valid pending user found in the flow |
| Failure | The stage returns an invalid response |
Add Secure Apps Flows Stages Stages Authenticator Duo Index (`website/docs/add-secure-apps/flows-stages/stages/authenticator_duo/index.mdx`)
title: Duo authenticator setup stage
The Duo Authenticator Setup stage enrolls a Duo authenticator for the current user.
About the Duo authenticator setup stage
This stage connects authentik to Duo and stores a Duo-backed authenticator for the user. Duo can then be used with the Authenticator Validation stage.
Configuration options
- API Hostname: the Duo API hostname for your tenant.
Under Duo Auth API:
- Integration key: Duo Auth API integration key.
- Secret key: Duo Auth API secret.
Under Duo Admin API (optional):
- Integration key: optional Duo Admin API integration key, used for importing existing Duo users and authenticators.
- Secret key: optional Duo Admin API secret, used together with the Admin API integration key.
- Authenticator type name: optional friendly name shown to the user in self-service settings.
- Configuration flow: optional authenticated flow that lets users enroll this authenticator from user settings.
Flow integration
Use this stage in an enrollment or user-settings flow where the user should enroll Duo.
To require Duo during authentication, add an Authenticator Validation stage to the login flow and allow the Duo device class.
Notes
- Duo authenticators created through this stage are tied to the stage because authentik needs that stage's API credentials during authentication.
- Because of that link, the stage cannot be deleted while authenticators created through it still exist. Delete those authenticators first, then delete the stage.
Import existing Duo authenticators
:::info
Due to the way the Duo API works, authentik can only automatically import existing Duo users when a Duo MFA or higher license is active.
:::
The Duo Auth API enrollment flow creates a new Duo user. If a Duo user already exists with the same username, Duo rejects the enrollment request. To use that existing Duo user in authentik, configure the optional Duo Admin API credentials on the stage and import the authenticator instead of using the enrollment flow. If the Admin API is not available, delete or rename the existing Duo user before enrolling the authenticator.
If you already have Duo users, you can import their authenticators into authentik from the Admin interface. The Duo username can be found in the Duo Admin dashboard under Users. If needed, you can also use the Duo user ID shown in the Duo Admin URL for that user.
For direct API use, the import endpoint accepts:
duo_user_id: the Duo user's ID from the Duo admin portalusername: the authentik username to assign the imported authenticator to
The stage_uuid in the request must be the Duo stage whose API credentials should be used.
Add Secure Apps Flows Stages Stages Authenticator Email Index (`website/docs/add-secure-apps/flows-stages/stages/authenticator_email/index.mdx`)
title: Email authenticator setup stage authentik_version: "2025.2"
The Email Authenticator Setup stage registers an email-based authenticator for the current user, enabling one-time codes to be sent via email during subsequent authentications.
About the email authenticator setup stage
During enrollment, the user supplies an email address if one is not already known, then confirms ownership by entering a one-time code.
The enrolled email address can later be used with the Authenticator Validation stage.
Configuration options
- Use global connection settings: use authentik's global email configuration instead of stage-specific SMTP settings.
- SMTP Host: SMTP server hostname for stage-specific email delivery.
- SMTP Port: SMTP server port.
- SMTP Username: optional SMTP username.
- SMTP Password: optional SMTP password.
- Use TLS: enable STARTTLS for the SMTP connection.
- Use SSL: enable SMTPS for the SMTP connection.
- Timeout: SMTP connection timeout in seconds.
- From address: sender address used for enrollment emails.
- Token expiry: how long the one-time code stays valid.
- Subject: subject line for the enrollment email.
- Template: email template used for the one-time code email. See Custom templates below.
- Authenticator type name: optional friendly name shown to the user in self-service settings.
- Configuration flow: optional authenticated flow that lets users enroll this authenticator from user settings.
For SMTP requirements and global email delivery settings, see Email configuration.
Custom templates
This stage supports custom email templates in the same way as the Email stage. Mount your custom templates into authentik's template directory, and they will appear in the stage's Template dropdown.
For the full mounting instructions (Docker Compose and Kubernetes), a list of available template variables, and an example template, see Custom templates in the Email stage documentation.
:::info
If a custom template does not appear in the Template selector, check the worker container logs. Templates are discovered when the stage configuration form loads.
:::
Flow integration
Use this stage in an enrollment or user-settings flow where the user should add an email authenticator.
To use the enrolled address during login, add an Authenticator Validation stage to the authentication flow and allow the Email device class.
Notes
- Email authenticators created through this stage are tied to it, so the stage cannot be deleted while any of those authenticators still exist. Delete the authenticators first, then delete the stage.
- If Use global connection settings is enabled, configure the global email settings first. See the installation docs for Docker Compose and Kubernetes.
- This stage is separate from the general-purpose Email stage, which is used for email verification and recovery.
- If the user already has an email address on their account, authentik can use that address during enrollment instead of prompting for a new address.
Add Secure Apps Flows Stages Stages Authenticator Endpoint Gdtc Index (`website/docs/add-secure-apps/flows-stages/stages/authenticator_endpoint_gdtc/index.mdx`)
title: Google Chrome Device Trust authenticator stage authentik_enterprise: true support_level: deprecated
:::warning Deprecated
This stage is deprecated in favor of the Google Chrome connector used with the Endpoint Devices feature set.
:::
The Google Chrome Device Trust Authenticator Stage verifies a Chrome browser by using the Chrome Verified Access API.
About the Google Chrome Device Trust authenticator stage
This stage validates Chrome Enterprise Device Trust signals from the user's browser. Unlike other authenticator setup stages, it does not enroll a reusable MFA device for later validation through the Authenticator Validation stage.
It was designed to integrate Chrome browsers and ChromeOS devices with authentik as the identity provider so access decisions could take device posture into account.
Typical use cases included remote-work, contractor, and BYOD environments where access should depend on the state of the browser or device in addition to the user's identity.
Configuration options
- Credentials: Google service-account JSON used to access the Chrome Verified Access API.
- Authenticator type name: optional friendly name shown to the user in self-service settings.
- Configuration flow: optional authenticated flow that exposes the stage in user settings.
Flow integration
Bind this stage directly into a flow where Chrome browser verification should happen.
Compared to the newer Endpoint stage, this stage is Chrome-specific and relies on the legacy Device Trust integration path.
Notes
Requirements
- Google Chrome is required.
- A Google Cloud project with the Chrome Verified Access API enabled is required.
- A service account with exported JSON credentials is required.
- Chrome Enterprise Device Trust must be configured in the Google admin side to call back into authentik.
This integration was commonly paired with context-aware access policies, for example only allowing access from devices that meet patching or compliance requirements.
Google setup outline
The original Chrome Device Trust setup has four main steps:
- Create a Google Cloud project and enable the Chrome Verified Access API.
- Create a service account.
- Export a JSON key for that service account.
- Configure Chrome Enterprise Device Trust to call authentik at
/endpoint/gdtc/chrome/.
More concretely:
- Open the Google Cloud Console and create a new project.
- Enable the Chrome Verified Access API in that project.
- In IAM > Service Accounts, create a service account.
- Generate a JSON key from the service account's Keys tab.
- In the Google admin side, configure a new provider under Chrome browser > Connectors and point it at your authentik URL, for example
https://authentik.company/endpoint/gdtc/chrome/. - Paste the exported JSON key into the stage's Credentials field in authentik.
Why this stage is different
This stage verifies the current Chrome browser directly and does not create a reusable MFA enrollment that is later selected by the Authenticator Validation stage. That difference is why the newer Endpoint stage is a better long-term replacement for most deployments.
Add Secure Apps Flows Stages Stages Authenticator Sms Index (`website/docs/add-secure-apps/flows-stages/stages/authenticator_sms/index.mdx`)
title: SMS authenticator setup stage
The SMS Authenticator Setup stage enrolls an SMS-based authenticator for the current user by using either Twilio or a generic HTTP endpoint.
About the SMS authenticator setup stage
This stage stores a phone number, enabling one-time codes to be sent via SMS.
In normal mode, the enrolled phone number can later be used with the Authenticator Validation stage. In verify only mode, the stage only verifies ownership of a phone number during enrollment and stores a hash instead of the number itself.
Configuration options
- Provider: choose either Twilio or Generic.
- From number: sender number or identifier used for outbound SMS.
- Account SID / External API URL: for Twilio this is the account SID; for the generic provider this is the target API URL.
- Auth / token: for Twilio this is the auth token; for the generic provider this is the bearer token or basic-auth username.
- Auth password: optional password for generic basic authentication.
- Auth type: choose Basic or Bearer authentication for the generic provider.
- Verify only: verify phone ownership during enrollment without storing the plain phone number for later MFA use.
- Mapping: optional webhook mapping used to customize the payload sent to custom providers.
- Authenticator type name: optional friendly name shown to the user in self-service settings.
- Configuration flow: optional authenticated flow that lets users enroll this authenticator from user settings.
Flow integration
Use this stage in an enrollment or user-settings flow where the user should add an SMS authenticator.
To require SMS during login, add an Authenticator Validation stage to the authentication flow and allow the SMS device class.
If you enable Verify only, phone numbers enrolled through this stage cannot be used by the Authenticator Validation stage.
Notes
SMS authenticators created through this stage are tied to it, so the stage cannot be deleted while any of those authenticators still exist. Delete the authenticators first, then delete the stage.
Twilio
For the Twilio provider, create a messaging service and collect the Account SID, Auth token, and a usable sender number from the Twilio console.
A typical Twilio setup looks like this:
- Log in to the Twilio console.
- Go to Explore Products > Messaging > Services.
- Create a new messaging service and choose a verification-oriented use case.
- Add a sender from the service's sender pool.
- Copy the Account SID and Auth token into the stage configuration.
Using a property mapping, you can customize the message sent via Twilio. The mapping should return a dictionary with a message key. For example:
return {
"message": f"This is a custom message for {request.http_request.brand.branding_title} SMS authentication. The code is {token}."
}Useful variables in that mapping include:
device.phone_numberstage.from_numberrequest.http_request.brand
Generic provider
For the generic provider, authentik sends an HTTP POST request to the configured API URL. The default payload contains:
{
"From": "<value of the From number field>",
"To": "<the phone number of the user's device>",
"Body": "<the token that the user needs to authenticate>",
"Message": "<the full SMS message>"
}Any response with status 400 or higher is treated as a failed send and blocks the user from proceeding.
You can also customize the generic-provider payload with a webhook mapping. For example:
return {
"from": stage.from_number,
"to": device.phone_number,
"body": f"foo bar baz {token}",
}Limiting phone numbers
To control which phone numbers are accepted, collect the number in a Prompt stage and validate it with an expression policy before this stage runs. If a prompt field uses the key phone, the SMS setup stage will read that value from prompt_data instead of prompting the user again.
Example expression policy:
phone_number = regex_replace(request.context["prompt_data"]["phone"], r"\s+", "")
if phone_number.startswith("+1234"):
return True
ak_message("Invalid phone number or missing region code")
return FalseA typical flow for this looks like:
- Create a required text prompt field with the key
phone. - Create a Prompt stage that contains that field.
- Bind the validation policy to the Prompt stage.
- Bind the Prompt stage before the SMS setup stage in the enrollment flow.
Add Secure Apps Flows Stages Stages Authenticator Static Index (`website/docs/add-secure-apps/flows-stages/stages/authenticator_static/index.mdx`)
title: Static authenticator setup stage
The Static Authenticator Setup stage creates one-time backup codes for a user. These codes are typically used as a fallback when the user's primary authenticator is unavailable.
About the static authenticator setup stage
This stage enrolls static backup codes for the current user and generates a set of recovery codes. Each code can be used once.
Because static codes are a device class supported by the Authenticator Validation stage, they are usually added as a backup factor rather than the primary factor.
Configuration options
- Token count: how many backup codes to generate for the user.
- Token length: how long each generated code should be.
- Authenticator type name: optional friendly name shown to the user in self-service settings.
- Configuration flow: optional authenticated flow that lets users enroll this authenticator from user settings.
Flow integration
Use this stage in an enrollment or user-settings flow where the user is already authenticated or otherwise identified.
To use the generated backup codes during authentication, add an Authenticator Validation stage to the login flow and allow the Static device class.
Notes
- Static codes are intended as emergency or backup credentials.
- Each code is consumed after a successful use.
- Codes are displayed in hyphenated groups of four characters (for example,
abcd-efgh-ijkl) to make them easier to read and type. Hyphens and spaces are ignored when a code is entered, so users can enter a code with or without them. Codes are case-sensitive.
Add Secure Apps Flows Stages Stages Authenticator Totp Index (`website/docs/add-secure-apps/flows-stages/stages/authenticator_totp/index.mdx`)
title: TOTP authenticator setup stage
The TOTP Authenticator Setup stage enrolls a time-based one-time password authenticator for the user, such as Google Authenticator, Authy, 1Password, or similar authenticator apps.
About the TOTP authenticator setup stage
This stage creates a TOTP authenticator for the current user and presents a standard OTP configuration URL that authenticator apps can scan or import.
The enrolled TOTP authenticator can then be used with the Authenticator Validation stage.
Configuration options
- Digits: choose whether generated codes use 6 or 8 digits.
- Authenticator type name: optional friendly name shown to the user in self-service settings.
- Configuration flow: optional authenticated flow that lets users enroll this authenticator from user settings.
Flow integration
Use this stage in an enrollment or user-settings flow where the user can add a TOTP authenticator.
To require that authenticator during login, add an Authenticator Validation stage to the authentication flow and allow the TOTP device class.
Notes
- Six-digit TOTP codes are the most widely compatible option.
- During enrollment, authentik uses the active brand's title as the issuer shown in the TOTP app. If you operate multiple authentik instances with the same usernames, distinct brand titles help avoid confusion in authenticator apps.
Add Secure Apps Flows Stages Stages Authenticator Validate Index (`website/docs/add-secure-apps/flows-stages/stages/authenticator_validate/index.mdx`)
title: Authenticator validation stage
The Authenticator Validation stage validates an already enrolled authenticator.
About the authenticator validation stage
This stage is used during authentication after a user has already enrolled one or more authenticators with a setup stage, such as:
- Duo Authenticator Setup stage
- Email Authenticator Setup stage
- SMS Authenticator Setup stage
- Static Authenticator Setup stage
- TOTP Authenticator Setup stage
- WebAuthn / FIDO2 / Passkeys Authenticator setup stage
Configuration options
- Not configured action: control what happens when the user has no compatible authenticator.
- Skip: continue the flow without MFA.
- Deny: deny access and end the flow.
- Configure: inject one of the configured enrollment stages and continue after that stage succeeds.
- Configuration stages: stages that can be injected when Not configured action is set to Configure.
- Device Classes: which enrolled authenticator types can be used at this step.
- Last validation threshold: skip validation if the user has successfully used a compatible device within the configured time window.
- WebAuthn User verification: user-verification requirement for WebAuthn authentication.
- WebAuthn Hints: browser hints that influence which WebAuthn authenticator is preferred.
- WebAuthn Device type restrictions: optionally limit which WebAuthn device types are allowed.
- Email OTP throttling factor: exponential back-off factor for Email devices after failed verification attempts.
- SMS OTP throttling factor: exponential back-off factor for SMS devices after failed verification attempts.
- TOTP throttling factor: exponential back-off factor for TOTP devices after failed verification attempts.
- Static OTP throttling factor: exponential back-off factor for static recovery codes after failed verification attempts.
Flow integration
This stage normally appears in authentication flows after Identification and Password, and before User Login.
If Not configured action is set to Configure, the stage can bootstrap enrollment by injecting one or more authenticator setup stages into the running flow.
Notes
Require more than one MFA method
To require users to enroll more than one MFA method and validate with each method on every login, add multiple Authenticator Validation stages to the same authentication flow.
Configure each validation stage with a different set of allowed Device Classes, and set Not configured action to Configure.
For example, to require both TOTP and WebAuthn:
- Create a TOTP setup stage and a WebAuthn setup stage if you do not already have them.
- Create an Authenticator Validation stage for TOTP:
- Set Device Classes to
totp. - Set Not configured action to Configure.
- Set Configuration stages to your TOTP setup stage.
- Set Device Classes to
- Create a second Authenticator Validation stage for WebAuthn:
- Set Device Classes to
webauthn. - Set Not configured action to Configure.
- Set Configuration stages to your WebAuthn setup stage.
- Set Device Classes to
- Bind both validation stages to your authentication flow in the order that users should enroll and validate them.
On first sign-in, users who do not yet have one of the required methods are prompted to configure it before the flow continues. On later sign-ins, each validation stage checks only the device classes configured on that stage.
Require at least two enrolled MFA methods of any type
If you want to require users to enroll at least two different MFA methods, regardless of which types they choose, use an Expression Policy to count the enrolled device classes for the user.
from authentik.stages.authenticator import devices_for_user
pending_user = request.context.get("pending_user")
if not pending_user or not pending_user.pk:
return False
device_types = {
device.__class__.__name__.lower().replace("device", "")
for device in devices_for_user(pending_user, confirmed=True)
}
return len(device_types) >= 2Bind the policy to the flow or stage binding that controls whether the user can continue without enrolling another authenticator.
If you select multiple Configuration stages on a single validation stage, users can choose which authenticator to enroll for that requirement.
Less-frequent validation
Set Last validation threshold to a non-zero value to avoid prompting on every login. Any compatible authenticator within the allowed classes can satisfy that threshold.
For code-based authenticators such as TOTP, Static, and SMS, values below seconds=30 are not useful because those authenticators do not store exact validation timestamps at sub-window precision.
Passwordless authentication
:::caution
Firefox has known issues with some Touch ID and platform-authenticator flows. See Mozilla bug 1536482 for one longstanding example.
:::
Passwordless authentication in this stage currently relies on WebAuthn authenticators.
To build a dedicated passwordless flow:
- Create an Authentication flow.
- Add an Authenticator Validation stage that allows the WebAuthn device class.
- Add any extra verification stages you still require.
- End the flow with a User Login stage.
If you want users to choose a passkey directly from the browser's autofill UI on the identification screen, configure Passkey autofill in the Identification stage. This requires a discoverable credential, also known as a resident key.
Users can either access the passwordless flow directly or reach it through an Identification stage's Passwordless flow link.
WebAuthn hints
:::info
Hints are advisory and browsers can ignore them based on available authenticators or platform capabilities.
:::
Optional hints can guide the browser toward a preferred authenticator type during WebAuthn authentication:
- Security key: prefer a portable FIDO2 device such as a YubiKey.
- Client device: prefer a built-in platform authenticator such as Touch ID or Windows Hello.
- Hybrid: prefer a platform authenticator on a nearby mobile device, typically through a QR code.
The order of selected hints matters. For example, selecting Security key before Hybrid asks the browser to prefer security keys before hybrid authentication.
Automatic authenticator selection
If the user has multiple compatible authenticators, authentik lets them choose one. After a successful validation, the last-used authenticator is automatically preferred the next time this stage runs.
WebAuthn authenticator type restrictions
WebAuthn Device type restrictions are an allowlist for already-enrolled WebAuthn authenticators. When no device types are selected, any enrolled WebAuthn authenticator that matches the stage's Device Classes can be used. When one or more device types are selected, authentik only allows WebAuthn authentication from enrolled devices whose recorded device type matches one of the selected entries.
The available device-type entries are populated from the FIDO Alliance Metadata Service data and additional AAGUID metadata bundled with the authentik release. This is useful when you need to limit authentication to specific hardware families or compliance profiles.
These restrictions only apply to WebAuthn devices that have a stored device type. Devices enrolled in authentik 2024.4 or later store this information when the authenticator returns a known AAGUID. Older WebAuthn enrollments or devices without a stored type cannot be matched by this filter. To enforce a device-type policy for enrollment and later authentication, configure the same allowlist on the WebAuthn / FIDO2 / Passkeys Authenticator setup stage and have users re-enroll devices that predate stored device types.
Throttling
To slow down brute-force attacks against code-based authentication methods, the stage applies an exponential back-off to each device after a failed verification attempt. The delay required between verification attempts grows with each successive failure:
delay_seconds = factor * 2^(n - 1)In this formula, factor is the per-device-class throttling factor configured on the stage and n is the number of successive failures on that device.
For example, with the default factor of 1, the required delay between attempts is 1, 2, 4, 8, 16, ... seconds. With a factor of 0.5, it is 0.5, 1, 2, 4, ... seconds. A successful verification resets the counter.
A factor of 0 disables throttling for that device class.
WebAuthn and Duo devices are not throttled.
Authentication logging
When passwordless authentication succeeds through this stage, authentik records the method as auth_webauthn_pwl in flow context and related events.
Example event context:
{
"auth_method": "auth_webauthn_pwl",
"auth_method_args": {
"device": {
"pk": 1,
"app": "authentik_stages_authenticator_webauthn",
"name": "test device",
"model_name": "webauthndevice"
}
}
}Add Secure Apps Flows Stages Stages Authenticator Webauthn Index (`website/docs/add-secure-apps/flows-stages/stages/authenticator_webauthn/index.mdx`)
title: WebAuthn / FIDO2 / Passkeys authenticator setup stage
The WebAuthn / FIDO2 / Passkeys Authenticator setup stage enrolls a WebAuthn authenticator for the current user.
About the WebAuthn authenticator setup stage
This stage supports common WebAuthn authenticator types, including:
- security keys such as YubiKey or Google Titan
- platform authenticators such as Windows Hello, Touch ID, or Face ID
- passkeys stored by operating systems or password managers
Enrolled authenticators can later be used with the Authenticator Validation stage.
Configuration options
- User verification: require, prefer, or discourage built-in user verification during registration.
- Resident key requirement: control whether the authenticator should create a discoverable credential.
- Authenticator Attachment: restrict enrollment to platform authenticators, cross-platform authenticators, or leave it unrestricted.
- Hints: browser hints that influence which authenticator is preferred during enrollment.
- Device type restrictions: limit enrollment to specific WebAuthn device types.
- Maximum registration attempts: maximum number of failed registration attempts before the stage denies access. A value of
0disables the limit. - Authenticator type name: optional friendly name shown to the user in self-service settings.
- Configuration flow: optional authenticated flow that lets users enroll this authenticator from user settings.
Flow integration
Use this stage in an enrollment or user-settings flow where the user should register a passkey or hardware key.
To require those devices during login, add an Authenticator Validation stage to the authentication flow and allow the WebAuthn device class.
If you want passkey autofill on the login form itself, configure the Identification stage to reference a WebAuthn-capable Authenticator Validation stage.
Notes
User verification
User verification controls whether authentik requires, prefers, or discourages user verification on the authenticator itself. On platform authenticators such as Windows Hello, that can determine whether a PIN or biometric check is required.
Resident key requirement
For passkey-based passwordless login, set Resident key requirement to Preferred or Required so the created credential is discoverable.
Authenticator attachment
Use Authenticator Attachment when the flow should prefer either removable authenticators such as YubiKeys or built-in authenticators such as Touch ID, Windows Hello, or password-manager passkeys.
Signature algorithms
Registration accepts EdDSA, ES256, and RS256 credentials, and the post-quantum ML-DSA-44, ML-DSA-65, and ML-DSA-87 algorithms (FIPS 204). Authenticators pick the first algorithm they support, so ML-DSA is only used by devices that offer nothing else. No shipping authenticator supports ML-DSA yet.
This controls the authenticatorAttachment parameter sent to the browser during WebAuthn registration:
- No preference is sent: the browser can offer any available authenticator.
- Platform: prefer a non-removable authenticator built into the device, such as Touch ID, Face ID, or Windows Hello.
- Cross-platform: prefer a roaming authenticator, such as a YubiKey or Google Titan.
If WebAuthn hints are configured and this option is left unset, authentik infers an attachment value from the selected hints for backward compatibility with older browsers.
WebAuthn hints
:::info
Hints are advisory and browsers can ignore them based on available authenticators or platform capabilities.
:::
Optional hints can guide the browser toward a preferred authenticator type during registration:
- Security key: prefer registering a credential with a portable FIDO2 device such as a YubiKey.
- Client device: prefer registering a credential with a built-in platform authenticator such as Touch ID or Windows Hello.
- Hybrid: prefer registering a credential using a platform authenticator on a nearby mobile device, typically through a QR code.
The order of selected hints matters. For example, selecting Security key before Hybrid asks the browser to prefer security keys before hybrid registration.
For backward compatibility with older browsers that do not support hints, authentik automatically infers the authenticatorAttachment parameter from the selected hints when Authenticator Attachment is not explicitly set:
- Only Security key and/or Hybrid hints:
cross-platform - Only Client device hints:
platform - If both client-device and cross-platform hints are selected, no value is inferred
Duplicate devices
The Prevent duplicate devices option was removed in 2026.8. It compared attestation certificates, which manufacturers share across entire production batches, so it rejected legitimate enrollments of a second security key. No configuration replaces it, and no action is needed when upgrading.
Device type restrictions
Device type restrictions are an allowlist for WebAuthn registration. When no device types are selected, authentik allows any WebAuthn authenticator that the browser and authenticator can register. When one or more device types are selected, authentik only allows registration when the authenticator returns an AAGUID that matches one of the selected entries.
The available device-type entries are populated from the FIDO Alliance Metadata Service data and additional AAGUID metadata bundled with the authentik release. This lets you restrict enrollment to specific hardware families or passkey providers listed in that metadata.
If you select specific device types, newly added metadata entries are not allowed automatically. Review this allowlist after authentik upgrades if your compliance policy should include newly recognized authenticators.
authentik also includes the special device-type authentik: Unknown devices. Select it only when you want to allow authenticators that return an AAGUID that is not present in authentik's device-type metadata. Authenticators that do not return an AAGUID cannot satisfy a device-type restriction.
Add Secure Apps Flows Stages Stages Captcha Index (`website/docs/add-secure-apps/flows-stages/stages/captcha/index.mdx`)
title: Captcha stage
The Captcha stage adds CAPTCHA verification to a flow by using Google reCAPTCHA or compatible alternatives like hCaptcha, Cloudflare Turnstile, and Cap.
About the Captcha stage
This stage verifies that the current interaction appears human before the flow continues.
It can either be bound to a flow or embedded inside the Identification stage by setting the Identification stage's Captcha stage option.
Configuration options
- Public Key: CAPTCHA site key.
- Private Key: CAPTCHA secret key.
- Interactive: enable an interactive CAPTCHA widget instead of score-based verification.
- Score Minimum Threshold: minimum accepted score for score-based providers.
- Score Maximum Threshold: maximum accepted score for score-based providers.
- Error on Invalid Score: show an error immediately when the score is outside the configured threshold. If disabled, the flow continues and policies can inspect the result from context.
- JavaScript URL: JavaScript loader URL for the provider.
- API Verification URL: verification endpoint URL for the provider.
- Request Content Type: content type used when authentik verifies the CAPTCHA token with the provider.
Flow integration
Use this stage anywhere a flow should require a CAPTCHA check, especially in enrollment, recovery, or other public-facing flows.
If you embed it in an Identification stage, configure the CAPTCHA provider for invisible or background use.
:::note CAPTCHA and passkey authentication
The CAPTCHA stage does not run when the user completes an Identification stage with a passkey, because authentik completes identification immediately after a successful WebAuthn check. For more information about this behavior and its security rationale, see CAPTCHA and passkey authentication.
:::
Notes
Google reCAPTCHA
:::note Supported versions
Google reCAPTCHA Enterprise, reCAPTCHA v2, and reCAPTCHA v3 are all supported.
:::
Use the keys from https://www.google.com/recaptcha/admin.
Recommended defaults for reCAPTCHA:
- Interactive: disabled for score-based reCAPTCHA
- Score Minimum Threshold:
0.5 - Score Maximum Threshold:
1.0 - JavaScript URL:
https://www.recaptcha.net/recaptcha/api.js - API Verification URL:
https://www.recaptcha.net/recaptcha/api/siteverify
hCaptcha
See https://docs.hcaptcha.com/switch.
Recommended values:
- Interactive: enabled
- JavaScript URL:
https://js.hcaptcha.com/1/api.js - API Verification URL:
https://api.hcaptcha.com/siteverify
Score thresholds only apply to hCaptcha Enterprise.
Cap
Cap is a self-hostable CAPTCHA server that uses proof-of-work challenges.
See https://trycap.dev/guide/.
authentik supports Cap's default widget. The floating widget is not supported.
Recommended values:
- Public Key: public Cap endpoint for the site key path, for example
https://cap.example.com/site-key/ - Private Key: Cap secret key
- Interactive: enabled
- JavaScript URL: self-hosted Cap widget asset, for example
https://cap.example.com/assets/widget.js. If you use a CDN, pin a reviewed release such ashttps://cdn.jsdelivr.net/npm/cap-widget@<version>instead of the unversioned package URL. See Cap releases. - API Verification URL: Cap verification endpoint, for example
https://cap.example.com/site-key/siteverify - Request Content Type: JSON
Cap does not use score thresholds.
Cloudflare Turnstile
See https://developers.cloudflare.com/turnstile/get-started/migrating-from-recaptcha.
Recommended values:
- Public Key: Turnstile site key
- Private Key: Turnstile secret key
- Interactive: enable when using invisible or managed Turnstile modes
- JavaScript URL:
https://challenges.cloudflare.com/turnstile/v0/api.js - API Verification URL:
https://challenges.cloudflare.com/turnstile/v0/siteverify
Turnstile does not use score thresholds.
Cloudflare Turnstile setup flow
If you are configuring Turnstile from scratch:
- Create the Turnstile widget in Cloudflare.
- Copy the Site Key into Public Key.
- Copy the Secret Key into Private Key.
- Enable Interactive if the Turnstile widget is configured as Invisible or Managed.
- Leave score thresholds at their defaults because Turnstile does not use them.
Add Secure Apps Flows Stages Stages Consent Index (`website/docs/add-secure-apps/flows-stages/stages/consent/index.mdx`)
title: Consent stage
The Consent stage asks the user to approve sharing data with an application or relying party.
About the consent stage
This stage is commonly used in authorization flows, where a user should explicitly consent before authentik shares profile data or other claims with an application.
The default default-provider-authorization-explicit-consent flow already includes a Consent stage.
A typical use case is prompting the user to allow authentik to share profile data such as name, email address, or avatar with the application they are signing in to.
Configuration options
- Mode: control how long a granted consent remains valid.
- Always require consent: prompt every time.
- Consent given lasts indefinitely: store consent without expiration.
- Consent expires: store consent until the configured expiry time.
- Consent expires in: expiration offset used when the mode is set to expiring consent.
Flow integration
Bind this stage into an authorization flow anywhere the user should see the consent prompt.
If you use the default explicit-consent authorization flow, the stage is already present and usually does not need to be added manually.
Notes
Default flow
If you are using the default default-provider-authorization-explicit-consent flow, you usually do not need to add a Consent stage manually because it is already present.
If you are building a custom authorization flow, the usual sequence is:
- Create the Consent stage.
- Bind it into the authorization flow.
- Optionally bind an expression policy to the stage binding if the consent text should be customized.
If you are adding the stage from scratch in the Admin interface, the typical workflow is:
- Go to Flows and Stages > Stages and create a Consent Stage.
- Set the Mode and, if needed, the expiry duration.
- Open the target authorization flow.
- Add the Consent stage to that flow's stage bindings.
Custom consent text
You can customize the text shown on the consent screen by setting the consent_header key in flow context before the stage runs, for example from an expression policy:
request.context["flow_plan"].context["consent_header"] = (
"Are you OK with your IdP provider sharing your user identification data "
"with the application?"
)
return TrueBind that policy to the Consent stage binding inside the authorization flow where you want the wording to change.
The binding workflow is:
- Open the authorization flow that contains the Consent stage.
- Go to Stage Bindings.
- Expand the Consent stage binding that should use the custom text.
- Bind the expression policy to that stage binding.
Stored consent
When consent is stored, authentik keeps track of the user, the application, and the granted permissions so later requests can reuse or re-prompt according to the selected mode.
Users can check their past consent approvals via the User Settings menu.
Add Secure Apps Flows Stages Stages Deny Index (`website/docs/add-secure-apps/flows-stages/stages/deny/index.mdx`)
title: Deny stage
The Deny stage stops the current flow immediately.
About the deny stage
Use this stage when the flow should end with access denied, including cases where the user is not signed in yet and group-based permissions are not available.
Configuration options
This stage has no stage-specific configuration options.
Flow integration
Bind this stage where a flow should stop after a policy or earlier stage determines that the user must not continue.
Notes
:::caution
To use this stage effectively, make sure Evaluate when flow is planned is disabled on the stage binding. See Planning and stage policies.
:::
If the binding is evaluated during flow planning, the denial can happen earlier than intended and skip the checks that were meant to decide whether the user should be denied.
Example: block a known IP range
One common use case is to bind a Deny stage to an expression policy that blocks requests from a specific IP range.
For example:
- Create a Deny stage.
- Create an Expression policy with logic such as:
from ipaddress import ip_network
return ak_client_ip in ip_network("203.0.113.0/24")- Bind that policy to the Deny stage in the flow.
When the policy passes, the Deny stage runs and the flow stops immediately.
Example: Block password recovery for inactive users
Account deactivation prevents authentication, but it does not automatically prevent recovery stages from sending email or changing a password. To stop inactive users before those actions occur:
Add a Deny stage to the recovery flow after the Identification stage and before the Email stage.
Create an Expression policy with the following expression:
pythonpending_user = request.context.get("pending_user") return bool( pending_user and pending_user.pk and not pending_user.is_active )Bind the policy to the Deny stage binding.
On the Deny stage binding, disable Evaluate when flow is planned and enable Evaluate when stage is run. The policy must run after the Identification stage adds
pending_userto the flow context.
The Deny stage runs only when the identified user exists and is inactive. Active users and placeholder users that represent unknown identifiers skip the Deny stage.
:::danger Account state disclosure
The Deny stage produces a different response for an inactive account than the Email sent. challenge that the Email stage displays for unknown and active accounts. An attacker can use this difference to determine that an account exists or is inactive.
Use this configuration only if disclosing account state is acceptable. A Deny stage cannot both stop recovery and preserve the Email stage's indistinguishable response.
:::
Add Secure Apps Flows Stages Stages Email Index (`website/docs/add-secure-apps/flows-stages/stages/email/index.mdx`)
title: Email stage
The Email stage sends a verification or action email from within a flow.
About the email stage
This stage is used for email verification, account recovery, invitations, and similar flow steps where authentik should send a tokenized link or message to a user.
The email is normally sent to the current pending_user, but the target address can be overridden from flow context.
When an email cannot be delivered immediately, authentik retries delivery through its background worker.
Configuration options
- Use global connection settings: use authentik's global email configuration instead of stage-specific SMTP settings.
- SMTP Host: SMTP server hostname for stage-specific delivery.
- SMTP Port: SMTP server port.
- SMTP Username: optional SMTP username.
- SMTP Password: optional SMTP password.
- Use TLS: enable STARTTLS for the SMTP connection.
- Use SSL: enable SMTPS for the SMTP connection.
- Timeout: SMTP connection timeout in seconds.
- From address: sender address used for flow emails.
- Account Recovery Max Attempts: maximum number of recovery emails allowed in the configured time window.
- Account Recovery Cache Timeout: time window used for recovery-email rate limiting.
- Activate user on success: set the identified user's
is_activestate toTrueafter they return with a valid email token. In a recovery flow, this setting allows an inactive user to reactivate their account through email verification. Disable this setting if reactivation must remain an administrative action. Disabling it does not prevent the user from receiving a recovery email or changing their password. - Token expiry: how long the email token remains valid.
- Subject: subject line used for the email.
- Template: template used to render the email body.
Flow integration
Use this stage in recovery, enrollment, verification, or invitation flows where an email should be sent before the flow continues.
By default, the message goes to the current pending_user. To override the destination, set email in the flow plan context before the stage runs:
request.context["flow_plan"].context["email"] = "[email protected]"
return TrueYou can also source the address from prompt data or another user attribute:
request.context["flow_plan"].context["email"] = request.context["prompt_data"]["email"]
return Truerequest.context["flow_plan"].context["email"] = request.context["pending_user"].attributes.get("otherEmail")
return TrueNotes
Rate limiting
The recovery rate-limiting fields only affect recovery-style email sends. They limit how many recent attempts a user can trigger within the configured time window.
Recovery and account enumeration
When an Identification stage does not find a user, it can create a placeholder user if Pretend user exists is enabled. In a recovery flow, the Email stage shows the same Email sent. challenge for this placeholder user without sending an email or creating a recovery token. This behavior prevents the recovery response from disclosing whether the identifier belongs to an account.
An existing inactive user is not a placeholder user. By default, the Email stage sends that user a recovery email and creates a recovery token. Deactivating an account prevents authentication, but it does not automatically prevent the user from recovering their account.
You can use a policy bound to a Deny stage to block inactive users before the Email stage. However, the denial response differs from the response for an unknown or active account and can disclose whether an account exists or is inactive. For configuration details and this security tradeoff, see Block password recovery for inactive users.
Custom templates
You can provide custom email templates.
:::info
You can also add a matching .txt file next to the .html file to send multipart text and HTML emails.
:::
import TabItem from "@theme/TabItem";
import Tabs from "@theme/Tabs";
<Tabs
defaultValue="docker-compose"
values={[
{label: 'Docker Compose', value: 'docker-compose'},
{label: 'Kubernetes', value: 'kubernetes'},
]}>
Place custom templates in the custom-templates directory next to your Compose file. The template becomes selectable in the Email stage configuration.
apiVersion: v1
kind: ConfigMap
metadata:
name: authentik-templates
namespace: authentik
data:
my-template.html: |
<tr>...Then mount it into the worker container from your Helm values:
volumes:
- name: email-templates
configMap:
name: authentik-templates
volumeMounts:
- name: email-templates
mountPath: /templatesIf a custom template does not appear in the selector, check the worker logs.
Template variables
Templates are rendered with Django's templating engine. Common variables include:
url: the full URL the user should openuser: the pending userexpires: when the token expires
These templates are rendered with Django's templating engine, so you can also use standard template inheritance and translation tags.
Example template
Templates can extend the base email template and use standard Django template tags. For example:
:::info
Each Django {% ... %} tag must stay on one line; a tag wrapped across lines won't parse.
:::
/* Detailed source-code truncated for AI context efficiency. */Add Secure Apps Flows Stages Stages Endpoint Index (`website/docs/add-secure-apps/flows-stages/stages/endpoint/index.mdx`)
title: Endpoint stage
The Endpoint stage checks whether the current browser or device is known to authentik's Endpoint Devices system and injects device facts into flow context.
About the endpoint stage
This stage integrates with Endpoint Devices. It can associate the current session with a managed endpoint and make device facts available to policies and later stages.
Configuration options
- Connector: which endpoint connector should be used to gather device information.
- Mode: whether endpoint verification is optional or required.
Flow integration
Use this stage in authentication or authorization flows where device posture should influence access decisions.
The device facts gathered by this stage can then be consumed by policies or by later flow logic.
Notes
- In required mode, the flow fails if the device cannot be verified.
- In optional mode, authentik attempts verification and can continue without attaching a device if verification does not complete in time.
Add Secure Apps Flows Stages Stages Identification Index (`website/docs/add-secure-apps/flows-stages/stages/identification/index.mdx`)
title: Identification stage
The Identification stage is the primary user-identification step in most authentik login flows.
About the identification stage
This stage lets the user identify themselves by username, email address, UPN, or external source. You can also embed password entry, CAPTCHA verification, and passkey autofill directly into the identification step.
Configuration options
- User Fields: which identifiers the user can enter.
- Username
- UPN
- Password stage: optional Password stage to render inline instead of as a separate step.
- Captcha stage: optional Captcha stage to run as part of identification.
- WebAuthn Authenticator Validation Stage: optional Authenticator Validation stage used for passkey autofill.
- Case-insensitive matching: match identifiers regardless of case. If two users have usernames that differ only by case, only one of them is matched. To prevent such usernames, see Ensure unique usernames regardless of case.
- Show matched user: display the matched user's username and avatar after a valid identifier is entered.
- Pretend user exists: continue even when the entered identifier does not match a real user.
- Enable remember me on this device: allow the browser to remember the entered username and jump directly to password entry later.
- Enrollment flow: optional flow linked as a sign-up path.
- Recovery flow: optional flow linked as a recovery path.
- Passwordless flow: optional flow linked as a dedicated passwordless sign-in path.
- Sources: which OAuth or SAML sources should be shown.
- Show source labels: show labels in addition to source icons.
Flow integration
This stage usually appears first in authentication and recovery flows.
- If Password stage is configured here, do not also bind that Password stage separately in the same flow.
- If Captcha stage is configured here, do not also bind that Captcha stage separately in the same flow.
- If no user fields are selected, the stage acts as a source-only entry point.
Notes
User fields
If no user fields are selected, only the configured sources are shown.
For UPN, authentik matches against the upn attribute on the user, which is commonly populated from an LDAP source.
Password and CAPTCHA embedding
If you set a Password stage here, the password prompt appears on the same step as identification instead of as a later stage.
If you set a Captcha stage here, configure that CAPTCHA for invisible or background use so it renders correctly inside the identification form.
Pretend user exists
When enabled, invalid identifiers still let the flow continue as long as the format is valid for the selected field type. Stages such as Password and Email are aware of this behavior and handle the synthetic pending user safely.
Source behavior
Selected OAuth and SAML sources are shown below the local identification form. If no user fields are selected and exactly one source is configured, authentik can redirect to that source automatically as long as Passwordless flow is not configured.
By default, sources are shown by icon only. Enable Show source labels if the source name should be shown alongside the icon.
Sources can also be marked as Promoted in their source configuration. Promoted sources are shown as prominent full-width buttons on the login page instead of small icon buttons.
Linked flows
The Enrollment flow and Recovery flow settings control the links shown below the identification form. The passwordless flow setting adds a direct link to a separate passwordless authentication flow.
When Enable remember me on this device is enabled, authentik can store the username locally and jump to the password field on later visits. Users can still select Not you? to enter a different username or disable the remembered value.
Passkey autofill (WebAuthn conditional UI):ak-version[2025.12]
When configured, the Identification stage can offer passkey login directly from the browser's passkey or autofill UI without requiring the user to type a username first.
authentik automatically falls back to the normal identification flow when passkey autofill is not available.
CAPTCHA and passkey authentication
When a user authenticates with a passkey through the Identification stage's WebAuthn configuration, authentik completes the stage immediately after the WebAuthn check. It does not run a CAPTCHA that is configured on the Identification stage, including an interactive CAPTCHA. This is intentional: CAPTCHA protects primarily against bots that guess, reuse, or vary credentials, while WebAuthn uses a cryptographic challenge and does not expose those attack paths. Skipping the CAPTCHA does not reduce protection against credential-guessing attacks and avoids an unnecessary challenge for passkey users.
If you need to reduce the impact of requests that consume resources during authentication, use rate limiting or similar controls in your reverse proxy configuration instead of relying on a CAPTCHA after a successful WebAuthn check.
Requirements
- HTTPS is required except on
localhost. - The browser must support WebAuthn conditional mediation.
- The user must have a compatible discoverable credential, also known as a resident key.
- The user must access authentik on the same hostname the passkey was created for.
Configuration
- Create or edit an Authenticator Validation stage that allows the WebAuthn device class.
- Set the Identification stage's WebAuthn Authenticator Validation Stage to that stage.
- Make sure users have already enrolled a WebAuthn authenticator, for example with the WebAuthn / FIDO2 / Passkeys Authenticator setup stage.
If the user has multiple passkeys, the browser shows its own picker. In the default authentication flow, authentik skips the MFA validation stage after a passkey login with an expression policy; adjust that policy if you still want a second factor after passkey login.
Troubleshooting
- If no passkey prompt appears, check HTTPS, browser support, and that the validation stage is configured. The browser normally triggers the passkey suggestion when the user focuses the username field.
- If no passkey prompt appears, make sure the login page is not embedded in an iframe because some browsers block conditional UI outside top-level browsing contexts.
- If the prompt appears but falls back to username/password, check that the referenced validation stage allows WebAuthn and that the user has a valid enrolled authenticator.
Add Secure Apps Flows Stages Stages Invitation Index (`website/docs/add-secure-apps/flows-stages/stages/invitation/index.mdx`)
title: Invitation stage
The Invitation stage is used to invite users to enroll in authentik. It can optionally enroll users with preset values.
About the invitation stage
This stage is typically used in enrollment flows where users should only be allowed to continue if they were invited by an administrator.
An invitation can also carry fixed data that is applied during enrollment.
Configuration options
- Continue flow without invitation: if enabled, the flow continues when no invitation token is present. If disabled, the flow stops when the token is missing.
Flow integration
Add this stage near the beginning of an enrollment flow that should be invitation-gated.
Users can enter the flow with an invitation token by using a URL like:
https://authentik.example/if/flow/your-enrollment-flow/?itoken=invitation-tokenYou can also collect the token with a Prompt stage by using a prompt field with the key token.
Notes
- In policies, you can check whether an invitation is active with
request.context.get("invitation_in_effect", False). - Invitation objects can be restricted to a specific flow and can be marked as single-use.
Add Secure Apps Flows Stages Stages Mtls Index (`website/docs/add-secure-apps/flows-stages/stages/mtls/index.mdx`)
title: Mutual TLS stage authentik_enterprise: true toc_max_heading_level: 5
The Mutual TLS stage authenticates or enrolls users by validating a presented client certificate.
About the mutual TLS stage
This stage uses a client certificate from the browser or device, such as one stored locally or on a smart card, PIV card, or hardware token.
Configuration options
- Mode: whether the certificate is optional or required.
- Certificate authorities: certificate authorities used to validate client certificates.
- Certificate attribute: which certificate attribute should be read for matching.
- subject
- common name
- User attribute: which user attribute should be compared against the certificate value.
- username
Flow integration
Use this stage in authentication or enrollment flows where client-certificate authentication is required or should be offered.
If Certificate authorities is left empty, authentik falls back to the client-certificate configuration on the active brand.
Notes
:::warning Use a private CA
Do not use a publicly trusted certificate authority for client authentication. Use a private PKI that is trusted only by your managed endpoints, and combine mTLS with policy checks when needed.
:::
Reverse-proxy configuration
When authentik is behind a reverse proxy, the proxy must validate the client certificate and forward it to authentik.
nginx
# server {
ssl_client_certificate /etc/ssl/path-to-my-ca.pem;
ssl_verify_client on;
# location / {
proxy_set_header ssl-client-cert $ssl_client_escaped_cert;
# }
# }ingress-nginx
nginx.ingress.kubernetes.io/auth-tls-pass-certificate-to-upstream: "true"
nginx.ingress.kubernetes.io/auth-tls-secret: namespace/secretNameThe referenced secret must contain ca.crt, which is the certificate authority used to validate client certificates.
See the ingress-nginx client-certificate documentation for details.
Traefik
tls:
options:
default:
clientAuth:
caFiles:
- tests/clientca1.crt
- tests/clientca2.crt
clientAuthType: RequireAndVerifyClientCertSee the Traefik mTLS documentation.
Traefik middleware
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: test-passtlsclientcert
spec:
passTLSClientCert:
pem: trueSee the Traefik PassTLSClientCert documentation for details.
Envoy
See the Envoy mTLS documentation and Envoy forwarded-client-cert header documentation for the required proxy configuration.
No reverse proxy
If authentik terminates TLS itself, configure the trusted client certificate authorities on the active brand.
Stage setup outline
After the reverse proxy or brand is configured to pass client certificates through:
- Create or import the certificate authority under System > Certificates.
- Create a Mutual TLS Stage under Flows and Stages > Stages.
- Set the stage Mode to either optional or required.
- Select the certificate authorities that should be trusted.
- Choose which certificate attribute should be matched against which user attribute.
- Bind the stage into the authentication or enrollment flow.
Matching behavior
The stage does not authenticate on certificate presence alone. It extracts the selected certificate attribute and compares it to the selected user attribute, so correctness of that mapping matters as much as trust-chain validation.
Add Secure Apps Flows Stages Stages Password Index (`website/docs/add-secure-apps/flows-stages/stages/password/index.mdx`)
title: Password stage
The Password stage prompts the current pending_user for a password and validates it against one or more configured backends.
About the password stage
Use this stage in authentication or password-change flows when a user should prove possession of a password.
The stage supports authentik's built-in password database, app passwords, LDAP-backed passwords, and Kerberos-backed passwords.
Configuration options
- Backends: select one or more password backends to test in order.
- User database + standard password
- User database + app passwords
- User database + LDAP password
- User database + Kerberos password
- Failed attempts before cancel: how many failed password submissions are allowed before the flow is canceled.
- Allow show password: show a button that reveals the entered password.
- Configuration flow: optional authenticated flow that lets users configure or change their password from user settings.
Flow integration
This stage is typically bound after an Identification stage and before an Authenticator Validation or User Login stage.
If the Identification stage has its Password stage option set, the password prompt is rendered as part of the identification step and the Password stage should not also be bound separately in the same flow.
Notes
:::tip
Service accounts have automatically generated app passwords. Those can be viewed from the service account's user settings or from the admin interface.
:::
Passwordless patterns
There are two common ways to avoid prompting for a password:
- Use an Authenticator Validation stage with WebAuthn for a dedicated passwordless flow.
- Conditionally skip the Password stage by binding a policy to its stage binding.
If you want users to be able to pick a passkey from the browser's passkey/autofill UI without entering a username first, configure Passkey autofill (WebAuthn conditional UI) in the Identification stage. This is separate from configuring a dedicated passwordless flow, and can be used alongside normal identification flows.
Dynamically skip a Password stage
This setup keeps a normal identification flow, but skips the Password stage for users who already have a supported authenticator configured.
To configure this setup:
- Log in to authentik as an administrator and open the authentik Admin interface.
- Navigate to Customization > Policies and create an Expression Policy.
- Configure the expression so that it returns
Trueonly when the Password stage should run. Use one of the expressions below, depending on the authenticator type. - Navigate to Flows and Stages > Flows and open your authentication flow.
- Open the Stage Bindings tab, expand the Password stage binding, and bind the Expression Policy there. Do not bind it to the flow itself or directly to the stage object. For more background, see Bind a policy to a stage binding.
- On the Password stage binding, enable Evaluate when stage is run. Disable Evaluate when flow is planned unless the user is already known before the flow starts. See Planning and stage policies.
WebAuthn
from authentik.stages.authenticator_webauthn.models import WebAuthnDevice
pending_user = request.context.get("pending_user")
if not pending_user:
return True
return not WebAuthnDevice.objects.filter(user=pending_user, confirmed=True).exists()Or for Duo:
from authentik.stages.authenticator_duo.models import DuoDevice
pending_user = request.context.get("pending_user")
if not pending_user:
return True
return not DuoDevice.objects.filter(user=pending_user, confirmed=True).exists()Because the expression already returns whether the Password stage should run, you do not need to enable Negate Result on the policy binding.
If the Password stage binding has more than one policy attached, review its Policy engine mode carefully:
- With only this policy attached, either mode works.
- If multiple policies are attached,
allrequires every policy to pass before the Password stage runs. - If multiple policies are attached,
anyruns the Password stage when any bound policy passes.
Default authentication flow
The built-in default-authentication-flow already includes a policy binding on its Password stage, default-authentication-flow-password-stage, which controls whether the Password stage should appear.
If you add a second policy to that same Password stage binding, set the stage binding's Policy engine mode to all so both the built-in policy and your Expression Policy must pass before the Password stage runs.
Keep Evaluate when stage is run enabled on that binding. In the default blueprint, this is already configured.
Add Secure Apps Flows Stages Stages Prompt Index (`website/docs/add-secure-apps/flows-stages/stages/prompt/index.mdx`)
title: Prompt stage
The Prompt stage prompts the user to enter information. The submitted values are then stored in the flow context.
About the prompt stage
Use this stage to collect user input, such as profile attributes, passwords, invitation tokens, file uploads, or approval choices.
Submitted values are written to prompt_data in the flow context and can be consumed by later stages or policies.
Configuration options
Stage options
- Fields: the ordered set of prompt definitions included in the stage.
- Validation Policies: optional policies evaluated after submission to validate the entered data.
Prompt field types
Each prompt field can use one of these types:
| Type | Description |
|---|---|
| Text | Arbitrary text input. |
| Text (read-only) | Text displayed but not editable. |
| Text area | Multiline text input. |
| Text area (read-only) | Multiline text displayed but not editable. |
| Username | Text input with username uniqueness checks. |
| Text input validated as an email address. | |
| Password | Masked input. Multiple password fields in the same stage must match. |
| Number | Numeric input. |
| Checkbox | Boolean checkbox input. |
| Radio Button Group | Single-choice selection rendered as radio buttons. |
| Dropdown | Single-choice selection rendered as a dropdown. |
| Date | Date picker. |
| Date-time | Date and time picker. |
| File | File upload stored in flow context as a data URI. |
| Separator | Static separator element. |
| Hidden | Hidden value inserted into the form submission. |
| Static | Static value displayed as-is. |
| authentik: Locale | Locale selector populated from authentik-supported locales. |
Prompt field attributes
Each prompt field definition includes these core attributes:
- field_key: key used to store the field value in
prompt_data. - label: label shown to the user.
- required: whether the field must be provided.
- placeholder: placeholder text, or for choice fields, the available choices.
- initial value: pre-filled value, or for choice fields, the default selected choice.
- order: numeric ordering among the prompt fields.
- Interpret placeholder as expression: evaluate the placeholder dynamically.
- Interpret initial value as expression: evaluate the initial value dynamically.
For Radio Button Group and Dropdown, the placeholder defines the valid choices. It can be a plain string, a list of values, or a list of objects with label and value.
Some field types also have special behavior:
- Username checks for uniqueness. The check is case-sensitive; to also reject usernames that differ only by case, see Ensure unique usernames regardless of case.
- Password fields within the same stage must all match.
- Hidden and Static use their configured values without user editing.
- Radio Button Group and Dropdown only allow values from the defined choice set.
Use prompt data to update a user
The Prompt stage does not update the user. It stores each submitted value in prompt_data under the prompt's Field Key.
To write a value to the user, bind a User Write stage after the Prompt stage. The User Write stage stores the value on the user when the Field Key is a user property or starts with attributes.:
| Field key | Result after the User Write stage |
|---|---|
username |
Sets the user's username. |
name |
Sets the user's display name. |
email |
Sets the user's email address. |
attributes.given_name |
Adds or updates given_name in the user's Attributes dictionary. |
attributes.family_name |
Adds or updates family_name in the user's Attributes dictionary. |
attributes.department |
Adds or updates department in the user's Attributes dictionary. |
attributes.settings.locale |
Adds or updates the nested value settings.locale in Attributes. |
A prompt with a Field Key such as department only adds the value to prompt_data, where policies and later stages can use it. The User Write stage does not store the value on the user because department is not a user property.
To store the value as a custom attribute, set the prompt's Field Key to attributes.department.
For a complete enrollment example, see Collect custom user attributes during enrollment.
Flow integration
Use this stage anywhere a flow needs user-provided input.
Common follow-ups include:
- A User Write stage to store collected values
- An Email or Invitation stage to act on collected data
- Policy checks that read from
request.context["prompt_data"]
Notes
Access submitted data
Prompt values are stored in prompt_data:
request.context.get("prompt_data", {}).get("<field_key>")Dynamic choices and defaults
For choice fields, placeholder and initial value can be generated dynamically with expressions. The prompt context is available during evaluation.
Choice fields also support context overrides:
<field_key>__choicesoverrides the available choices<field_key>overrides the initial value
For Radio Button Group and Dropdown, choices can be plain values or objects like:
return [
"first option",
42,
{"label": "another option", "value": "some value"},
]For fixed-choice fields, the default value must be one of the valid choices.
When prompt expressions are evaluated, they run in the same general expression environment used by authentik mappings and policies and also have access to prompt_context.
Validation
Additional validation can be done with validation policies bound directly to the Prompt stage. For example, to ensure two password fields match:
if request.context["prompt_data"]["password"] == request.context["prompt_data"]["password_repeat"]:
return True
ak_message("Passwords don't match.")
return FalseAdd Secure Apps Flows Stages Stages Redirect Index (`website/docs/add-secure-apps/flows-stages/stages/redirect/index.mdx`)
title: Redirect stage authentik_version: "2024.12"
The Redirect stage sends the user to another flow or a static URL.
About the redirect stage
This stage is most commonly used to branch from one flow into another while optionally preserving the current flow context.
Configuration options
- Keep flow context: preserve the current flow context when redirecting to another flow.
- Mode: choose whether the target is a static URL or another flow.
- Static target: URL used in static mode.
- Target Flow: flow used in flow mode.
Flow integration
Use this stage when the flow should hand off to another flow or redirect to a fixed destination.
In flow mode, the redirected flow can continue using the existing flow context if Keep flow context is enabled.
Notes
- You can override the target dynamically from an expression policy by setting
redirect_stage_targetin the flow context. - When Keep flow context is disabled, authentik clears the current flow context before handing off, except for the redirect marker used internally to track the redirect.
Add Secure Apps Flows Stages Stages Source Index (`website/docs/add-secure-apps/flows-stages/stages/source/index.mdx`)
title: Source stage authentik_enterprise: true
The Source stage sends the user to an OAuth or SAML source before returning to the flow.
About the source stage
Use this stage when an external identity provider should be part of the current authentik flow, for example during staged migrations or additional external verification.
Common examples include:
- Authenticating against a legacy IdP such as Microsoft Entra ID, Google Workspace, or Okta during an IdP migration and then using the returned identity and attributes inside authentik
- Routing users through an external OAuth or SAML identity provider
- Sending users through a custom device-health or posture-check system before continuing
For pure authentication or enrollment, an OAuth or SAML source can also be used directly without a Source stage. Use the Source stage when that external step needs to be embedded inside another authentik flow.
Configuration options
- Source: the OAuth or SAML source to use.
- Resume timeout: how long authentik keeps the suspended flow available while the user is away at the external source.
Flow integration
Bind this stage to a flow when the user should authenticate or enroll through an external source and then return to the authentik flow.
The configured source must be a browser-based source such as OAuth or SAML. LDAP and other non-browser sources are not compatible.
Notes
Important source-flow behavior
Do not bind a User Login stage to the source's own authentication or enrollment flow.
The Source stage resumes the original flow by appending a dynamic in-memory stage to the source flow. If the source flow logs the user in directly, the original flow will not resume correctly.
Workflow
sequenceDiagram
participant u as User
participant ak as authentik
participant eidp as External IDP
u->>ak: User initiates flow
ak->>u: User reaches Source stage
u->>eidp: User is redirected to external IDP
eidp->>ak: User authenticates with external IDP
alt User already linked to external IDP
ak->>u: Source authentication flow starts
u->>ak: User finishes source authentication flow
else User must be linked first
ak->>u: Source enrollment flow starts
u->>ak: User finishes source enrollment flow
end
ak->>u: Original authentik flow resumesResume timeout
If the user takes longer than the configured timeout to return from the external source, the original suspended flow is discarded and the flow restarts from the beginning on return.
Add Secure Apps Flows Stages Stages User Delete Index (`website/docs/add-secure-apps/flows-stages/stages/user_delete/index.mdx`)
title: User delete stage
The User Delete stage deletes the current pending_user.
About the user delete stage
This stage is intended for unenrollment or account-removal flows where a user account should be removed from authentik after the user has already been verified.
Configuration options
This stage has no stage-specific configuration options.
Flow integration
Use this stage near the end of an unenrollment flow after any confirmation, re-authentication, or policy checks have occurred.
Notes
:::danger
This stage deletes the pending_user without showing a confirmation prompt. Make sure the flow includes the checks and confirmation steps you want before the stage runs.
:::
The deleted user is also removed from the current session.
Add Secure Apps Flows Stages Stages User Login Index (`website/docs/add-secure-apps/flows-stages/stages/user_login/index.mdx`)
title: User login stage toc_max_heading_level: 4
The User Login stage attaches the current pending_user to a new authentik session.
About the user login stage
This stage is usually the final stage in authentication, enrollment and recovery flows, signing the user in immediately upon success.
Configuration options
- Session duration: how long the created session should last. A value of
seconds=0keeps the session until the browser session ends. - Network binding: optionally bind the session to ASN, network, or IP-derived network information.
- GeoIP binding: optionally bind the session to continent, country, or city information.
- Terminate other sessions: revoke the user's other active authentik sessions when this stage succeeds.
- Remember me offset: extend the session when the user explicitly chooses the remember-me option. A value of
seconds=0hides the option. - Remember device: store a longer-lived cookie that helps authentik recognize a known device on later sign-ins.
Flow integration
Use this stage near the end of flows that should create an authenticated browser session.
Common placements include:
- after a Password or Authenticator Validation stage in authentication flows
- after a User Write stage in enrollment flows
Notes
:::warning
Browsers handle session cookies differently. A session configured with seconds=0 is intended to end when the browser session ends, but some browsers can retain session state longer.
:::
Duration fields use the standard authentik timedelta syntax such as hours=1,minutes=30,seconds=0.
All values accept floating-point numbers.
Valid keys in those duration strings include:
microseconds
milliseconds
seconds
minutes
hours
days
weeks
If Remember me offset is greater than
seconds=0, authentik shows the user a Remember me on this device option during login.If Remember device is enabled, authentik stores a cookie that can be used in later flows or policies to distinguish known from unknown devices.
If the user already has another authenticated session from the same IP address, authentik also classifies that sign-in as coming from a known device.
If Network binding or GeoIP binding is enabled, authentik terminates sessions that later violate the selected binding.
When a session is terminated because a binding is broken, the generated logout event includes additional binding data describing what changed.
{
"asn": {
"asn": 6805,
"as_org": "Telefonica Germany",
"network": "5.4.0.0/14"
},
"geo": {
"lat": 51.2993,
"city": "",
"long": 9.491,
"country": "DE",
"continent": "EU"
},
"binding": {
"reason": "network.missing",
"new_value": {
"asn": 6805,
"as_org": "Telefonica Germany",
"network": "5.4.0.0/14"
},
"previous_value": {}
},
"ip": {
"previous": "1.2.3.4",
"new": "5.6.7.8"
},
"http_request": {
"args": {},
"path": "/if/admin/",
"method": "GET",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
},
"logout_reason": "Session binding broken"
}For alerting and policy use, authentik can also classify a login as coming from a known or unknown device based on the "Remember me on this device" cookie and related session information.
See the notification policy examples for logins from unknown devices.
When Terminate other sessions is enabled, previous authentik sessions for the same user are revoked. This does not affect OAuth refresh tokens.
Add Secure Apps Flows Stages Stages User Logout Index (`website/docs/add-secure-apps/flows-stages/stages/user_logout/index.mdx`)
title: User logout stage
The User Logout stage ends the user's authentik session and, if configured, initiates Single Logout.
About the user logout stage
This stage removes the current authentik session. When Single Logout is enabled for SAML or OIDC providers, authentik can also inject additional logout handling for those provider sessions.
Configuration options
This stage has no stage-specific configuration options.
Flow integration
The default flows use this stage differently:
default-invalidation-flow: used when the user logs out directly from authentik. This flow includes the User Logout stage.default-provider-invalidation-flow: the default flow used when a logout starts from an application. This flow does not include the User Logout stage.
If RP-initiated logout should also end the main authentik session, select default-invalidation-flow as the invalidation flow of the provider. For more information, see Choose the logout behavior for a provider.
Notes
When this stage runs, authentik can inject additional logout stages for active provider sessions:
- front-channel iframe logout stages
- front-channel native logout stages
- back-channel logout execution
This enables automatic provider-specific logout without manually adding those stages to the flow.
Add Secure Apps Flows Stages Stages User Write Index (`website/docs/add-secure-apps/flows-stages/stages/user_write/index.mdx`)
title: User write stage
The User Write stage writes data from the current flow context into a user object.
About the user write stage
This stage updates the current pending_user, or creates a new user if the flow does not already have one and the configured creation mode allows it.
It is commonly used in enrollment, recovery, and profile-update flows after a Prompt stage has collected input into prompt_data.
Configuration options
- User creation mode: control whether the stage never creates users, creates them only when required, or always creates them.
- Create users as inactive: mark newly created users as inactive.
- Create users group: optionally add newly created users to a specific group.
- User type: select the user type for newly created users: Internal, External, or Service Account.
- User path template: optionally set the path new users will be created under. If left blank, the default path will be used.
Data written to users
The stage reads values from prompt_data in the flow context. The key tells the stage where to store each value:
| Prompt data key | Result on the user |
|---|---|
username |
Sets the built-in username. |
name |
Sets the built-in display name. |
email |
Sets the built-in email address. |
password |
Sets the user's password. |
attributes |
Merges a dictionary into the user's attributes. |
attributes.<key> |
Sets a custom user attribute. |
attributes.<group>.<key> |
Sets a nested custom user attribute. |
For example, prompt fields with the keys attributes.given_name and attributes.family_name produce these user attributes:
family_name: Roy
given_name: DominicUse attributes.<key> for custom attributes. The stage does not write other keys, such as department, to the user; their values remain in prompt_data until the flow ends, available to later stages and policies.
For a complete configuration procedure, see Collect custom user attributes during enrollment.
Flow integration
Use this stage after one or more stages that populate flow context, usually an Identification stage, Prompt stage, or Email stage.
In enrollment flows, this stage is often followed by a User Login stage so the newly created user is immediately signed in.
Notes
Invitation data
An Invitation stage adds the invitation's built-in properties and custom attributes to prompt_data. The User Write stage stores an attributes dictionary or dotted keys such as attributes.department in the same way as submitted prompt values. For more information, see Invitations.
Dynamic groups
To add users to dynamic groups, set groups in the flow plan context before this stage runs. The value must be a list of actual Group objects:
from authentik.core.models import Group
group, _ = Group.objects.get_or_create(name="some-group")
request.context["flow_plan"].context["groups"] = [group]
return TrueCustomize Policies Types Expression Index (`website/docs/customize/policies/types/expression/index.mdx`)
title: Expression Policies
tags:
- policy
- expression
- python
Expression policies let you write custom Python for cases where the built-in policy types are not enough.
They are commonly used to:
- branch or redirect inside authentication flows
- validate prompt data
- enforce organization-specific access rules
- make decisions based on request metadata, GeoIP, ASN, or flow context
For general policy concepts such as bindings, ordering, Any vs All, and where policies are attached, see Policy bindings and evaluation.
:::warning Privileged Feature
Expression policies execute server-side Python inside authentik. Treat the ability to create or edit them as a highly privileged permission.
:::
Start here
- Expression reference covers return values, helper functions, variables, and flow context.
- Managing flow context keys shows how to change flow behavior.
- Switch which source is used based on email address shows a common routing pattern.
- Ensure unique email addresses, Ensure unique usernames regardless of case, and Allow only specific email domains cover prompt-data validation.
A simple example
The following expression causes an MFA validation stage to run only for one specific user:
if request.context["pending_user"].username == "marie":
return True
return FalseWhen the policy is bound to the stage binding, the stage runs only when the expression passes.
To understand what values are available in the expression environment, see Expression reference.
Common pitfalls
Use `context['pending_user']` inside flows
When a policy runs during a flow, request.user is not always the user who is currently being authenticated. Until a login or user-writing stage updates the active user, request.user may still be AnonymousUser or the previously authenticated user.
Inside authentication and enrollment flows, prefer:
pending_user = request.context.get("pending_user")instead of relying on request.user.
Prompt data lives in `context['prompt_data']`
If you are validating values entered in a Prompt stage, read them from context["prompt_data"]:
email = context["prompt_data"]["email"]Flow state can be changed through `flow_plan`
When an expression runs inside a flow, you can inspect and update flow state through context["flow_plan"] and context["flow_plan"].context. This is powerful, but it also means your expression can change how the rest of the flow behaves.
For examples, see Managing flow context keys and Switch which source is used based on email address.
Sample expression policies
The following examples document common uses:
- Switch which source is used based on email address
- Managing flow context keys
- Ensure unique email addresses
- Ensure unique usernames regardless of case
- Allow only specific email domains
`auth_method` and `auth_method_args`
Depending on the flow, context["auth_method_args"] may also be populated.
Some fields from the flow-plan context are mirrored into the root policy context and updated from it, such as prompt_data, but not every flow-plan key is copied that way.
Common auth_method values include:
password: standard password loginauth_mfa: MFA login without a password stepauth_webauthn_pwl: passwordless WebAuthn or passkey logintoken: token-based authentication, such as an app passwordjwt: machine-to-machine login through an external JWTldap: LDAP bind authentication
For some authentication methods, context["auth_method_args"] contains additional structured data.
For auth_mfa, context["auth_method_args"] is shaped like:
{
"mfa_devices": [
{
"pk": 1,
"app": "otp_static",
"name": "Static Token",
"model_name": "staticdevice"
}
]
}For token, context["auth_method_args"] depends on the code path. It may contain a token object:
{
"token": {
"pk": "f6d639aac81940f38dcfdc6e0fe2a786",
"app": "authentik_core",
"name": "test (expires=2021-08-23 15:45:54.725880+00:00)",
"model_name": "token"
}
}or a token identifier:
{
"identifier": "service-account-token"
}For ldap, context["auth_method_args"] contains information about the source used:
{
"source": {}
}For simple country or ASN checks, a GeoIP policy is usually easier to manage than a custom expression. For flow manipulation, see the example pages above.
Endpoint Devices Authentik Agent Device Authentication Cli App Authentication Index (`website/docs/endpoint-devices/authentik-agent/device-authentication/cli-app-authentication/index.mdx`)
title: CLI application authentication sidebar_label: CLI application authentication tags: [authentik Agent, authentik cli, kubernetes, k8s, aws, cli] authentik_version: "2025.12.0"
import DocCardList from "@theme/DocCardList";
The authentik Agent can authenticate to CLI applications such as aws and kubectl.
How CLI authentication works
First, authentik-agent and authentik-cli request an authentik token from the authentik-cli OAuth Provider and exchange it for a token from the specified Kubernetes or AWS provider.
This token is cached until expiration. This improves performance by eliminating repeated token requests.
More information
For more information, refer to each of the topics below:
Endpoint Devices Authentik Agent Device Authentication Local Device Login Index (`website/docs/endpoint-devices/authentik-agent/device-authentication/local-device-login/index.mdx`)
title: Local device login sidebar_label: Local device login tags: [authentik Agent, device login, device authentication, windows credential provider, wcp] authentik_enterprise: true authentik_version: "2025.12.0"
import DocCardList from "@theme/DocCardList";
Local device login allows you to log in to devices using authentik credentials instead of separate local accounts.
Users authenticate with authentik, just like they do for any application. The operating system login screen on a laptop, desktop, or server is connected to authentik.
Local device login is currently only supported on Windows and Linux.
For more information, pick a topic below:
Users Sources Sources Directory Sync Active Directory Index (`website/docs/users-sources/sources/directory-sync/active-directory/index.mdx`)
title: Active Directory
Preparation
The following placeholders are used in this guide:
ad.companyis the name of the Active Directory domain.authentik.companyis the FQDN of the authentik installation.
Active Directory configuration
To support the integration of Active Directory with authentik, you need to create a service account in Active Directory.
Open Active Directory Users and Computers on a domain controller or computer with Active Directory Remote Server Administration Tools installed.
Navigate to an Organizational Unit, right-click it, and select New > User.
Create a service account, matching your naming scheme, for example:
Set the password for the service account. Ensure that the Reset user password and force password change at next logon option is not checked.
Either one of the following commands can be used to generate the password:
shpwgen 64 1shopenssl rand 36 | base64 -w 0Open the Delegation of Control Wizard by right-clicking the domain Active Directory Users and Computers, and selecting All Tasks.
Select the authentik service account that you've just created.
Grant these additional permissions. They are required only when User password writeback is enabled on the LDAP source in authentik, and depend on your Active Directory domain.
:::note Limiting service account permissions
Optionally, if you don't want authentik to be able to view and sync objects within certain Organizational Units, you can limit the service account's permissions:
- Right-click the Organizational Unit in question and navigate to Properties > Security.
- Select the authentik service account that you created.
- Under the Deny column, check Read.
- Click Apply.
You can repeat this process for other OUs and objects within Active Directory.
:::
:::note LDAP signing
By default, Windows Server 2025 requires LDAP signing, which can disrupt authentik's Active Directory connectivity if LDAPS is not in use. You can address this by enabling LDAPS or by disabling LDAP signing on the domain controller. Disabling LDAP signing has security implications.
:::
authentik setup
To support the integration of authentik with Active Directory, create a new LDAP source in authentik.
Log in to authentik as an administrator and open the authentik Admin interface.
Navigate to Directory > Federation and Social login.
Click Create and select LDAP Source as the type.
Provide a name, slug, and the following required configurations:
Under Connection settings:
- Server URI:
ldap://ad.company
:::info
For authentik to be able to write passwords back to Active Directory, make sure to useldaps://as a prefix. You can verify that LDAPS is working by opening theldp.exetool on a domain controller and attempting a connection to the server via port 636. If a connection can be established, LDAPS is functioning as expected. More information can be found in the Microsoft LDAPS documentation.Multiple servers can be specified by separating URIs with a comma (for example,
ldap://dc1.ad.company,ldap://dc2.ad.company). If a DNS entry with multiple records is used, authentik selects a random entry when first connecting.
:::- Bind CN:
<service account>@ad.company - Bind Password: the password of the service account created in the previous section.
- Base DN: the base DN that you want authentik to sync.
Under LDAP Attribute mapping:
- User Property Mappings: select all mappings that start with
authentik default LDAPandauthentik default Active Directory. - Group Property Mappings: select
authentik default LDAP Mapping: Name.
Under Additional settings, adjust these optional configurations based on the setup of your domain:
- Group: if enabled, all synchronized groups will be given this group as a parent.
- Addition User/Group DN: additional DN that is prepended to the base DN configured above to limit the scope of user and group synchronization.
- User object filter: objects that should be considered users (for example,
(objectClass=user)). For Active Directory, set it to(&(objectClass=user)(!(objectClass=computer)))to exclude computer accounts. - Group object filter: objects that should be considered groups (for example,
(objectClass=group)). - Lookup using a user attribute: acquire group membership from a user object attribute (
memberOf) instead of a group attribute (member). This works with directories and nested group memberships (Active Directory, Red Hat IDM/FreeIPA), usingmemberOf:1.2.840.113556.1.4.1941:as the group membership field. - Group membership field: the user object attribute or group object attribute that determines the group membership of a user (for example,
member). If Lookup using a user attribute is set, this should be a user object attribute. Otherwise, this should be a group object attribute. - User membership attribute: ensure that this is set to
distinguishedName. - Object uniqueness field: a user attribute that contains a unique identifier (for example,
objectSid).
- Server URI:
Click Finish to save the LDAP source. An LDAP synchronization begins in the background. After it is complete, view the summary by navigating to Dashboards > System Tasks:
To finalize the Active Directory setup, enable the
authentik LDAPbackend in the password stage.
Users Sources Sources Directory Sync Freeipa Index (`website/docs/users-sources/sources/directory-sync/freeipa/index.mdx`)
title: FreeIPA
Preparation
The following placeholders are used in this guide:
svc_authentikis the name of the bind account.freeipa.companyis the name of the domain.ipa1.freeipa.companyis the name of the FreeIPA server.
FreeIPA setup
Log in to FreeIPA.
Create a user in FreeIPA that matches your naming scheme. Provide a strong password. Example generation methods are
pwgen 64 1oropenssl rand 36 | base64 -w 0. After you are done, click Add and Edit.In the user management screen, select the Roles tab.
Add a role that has privileges to change user passwords. The default
User Administratorsrole is sufficient. This is needed to support password resets from within authentik.By default, if an administrator account resets a user's password in FreeIPA, the user's password expires after the first use and must be reset again. This is a security feature to ensure password complexity and history policies are enforced. To bypass this feature for a more seamless experience, make the following modification on each FreeIPA server:
text$ ldapmodify -x -D "cn=Directory Manager" -W -h ipa1.freeipa.company -p 389 dn: cn=ipa_pwd_extop,cn=plugins,cn=config changetype: modify add: passSyncManagersDNs passSyncManagersDNs: uid=svc_authentik,cn=users,cn=accounts,dc=freeipa,dc=company
:::info
For more information, see 22.1.2. Enabling Password Reset Without Prompting for a Password Change at the Next Login.
:::
authentik setup
:::note
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.
See the LDAP Source documentation for more information on these settings.
:::
To create a new LDAP source in authentik:
Log in to authentik as an administrator and open the authentik Admin interface.
Navigate to Directory > Federation and Social login, click New Source, select LDAP Source, and click Next.
Configure the following settings:
Name: Provide a descriptive name for the LDAP source.
Slug: Provide a slug for the LDAP source.
Update internal password on login: Enable this if you want users to still be able to log in when FreeIPA is unavailable.
Delete not found object: Enable to delete users from authentik when they are deleted in FreeIPA.
Under Connection settings:
- Server URI:
ldaps://ipa1.freeipa.company
:::tip
You can specify multiple server URIs separated by commas (for example,ldap://ipa1.freeipa.company,ldap://ipa2.freeipa.company). If you use a DNS record with multiple entries, authentik picks one at random on first connection.
::: - Enable StartTLS: Enable for
ldap://protocol, disable forldaps://. - TLS Verification Certificate: Optionally select the certificate used to validate the remote certificate.
- Bind CN:
uid=svc_authentik,cn=users,cn=accounts,dc=freeipa,dc=company - Bind Password: The password for the user account above.
- Base DN:
dc=freeipa,dc=company
- Server URI:
Under LDAP Attribute mapping:
- User Property Mappings: Select all Mappings whose names begin with
authentik default LDAPandauthentik default OpenLDAP. Deselect any other Mappings that are selected by default. - Group Property Mappings: Select
authentik default OpenLDAP Mapping: cn
- User Property Mappings: Select all Mappings whose names begin with
Under Additional settings:
- Additional Parent Group: If selected, all synchronized groups will be given this authentik group as a parent.
- User Path: The path that users will be saved under in authentik.
- Addition User/Group DN:
cn=users,cn=accounts - Addition Group DN:
cn=groups,cn=accounts - User object filter:
(objectClass=person) - Group object filter:
(objectClass=groupofnames) - Group membership field:
memberOf - User membership attribute:
distinguishedName - Lookup using user attribute: Enabled.
- Object uniqueness field:
ipaUniqueID
:::caution
FreeIPA groups can contain nested groups. ThememberOfuser attribute lists all group memberships, direct and indirect.If you want to sync only direct group memberships, use the following settings:
- Group membership field:
member - User membership attribute:
distinguishedName - Lookup using user attribute: Disabled.
:::
Click Finish.
Manual synchronization
After saving the source, start a synchronization by opening the source, going to the Sync tab, and clicking Run sync again.
Finally, confirm that the User database + LDAP password backend is selected in Flows and Stages > Stages > Password stage.
Blueprints
You can also configure the LDAP source with a blueprint:
:::note
You must set the username (dn) and password in the environment variables FREEIPA_DN and FREEIPA_PASSWORD.
:::
/* Detailed source-code truncated for AI context efficiency. */:::note
If using LDAP, prepend the server URI with ldap:// and include start_tls: true.
:::
Users Sources Sources Directory Sync Jumpcloud Index (`website/docs/users-sources/sources/directory-sync/jumpcloud/index.mdx`)
title: JumpCloud
import TabItem from "@theme/TabItem";
import Tabs from "@theme/Tabs";
authentik can synchronize users and groups from JumpCloud using an LDAP source or a SCIM source. LDAP also lets users log in with their JumpCloud passwords. SCIM provisions directory data only and requires a separate authentication method.
Preparation
The following placeholders are used in this guide:
authentik.companyis the FQDN of the authentik installation.
<Tabs
defaultValue="ldap"
values={[
{ label: "LDAP", value: "ldap" },
{ label: "SCIM", value: "scim" },
]}
Configure LDAP
Configure JumpCloud
Create an LDAP binding user
Create a binding user as described in JumpCloud's Cloud LDAP documentation:
- Log in to the JumpCloud Admin Portal.
- Navigate to Identity Management > Users and create a binding user that matches your naming scheme.
- Open the user, and under Details > User Security Settings and Permissions > Permission Settings, enable Enable as LDAP Bind DN.
- Save the user.
Assign users and groups to LDAP
Only assigned users and groups are available over LDAP. Groups must contain at least one user to appear in LDAP. See Create an LDAP group.
- Navigate to Access > LDAP.
- Open the User Groups tab and select the groups whose members authentik should synchronize. Binding a group grants all of its members access to the LDAP directory.
- Open the Users tab and confirm that the accounts you expect to sync, including the binding user, are present. Add any individual users that are not covered by a bound group.
- Save your changes.
- Note your JumpCloud Organization ID for the Base DN in the next section.
Create the LDAP source in authentik
The example below uses the US LDAP endpoint. For other regions, use the hostname listed in JumpCloud's Cloud LDAP documentation.
authentik uses one Object uniqueness field for both users and groups. This configuration uses cn, which must be unique among synchronized users and among synchronized groups. JumpCloud uses the user's full name for cn, so check for duplicate names before synchronizing. Changing a cn changes the object's identifier in authentik. Use SCIM if you cannot keep these names unique and stable.
Log in to authentik as an administrator and open the authentik Admin interface.
Navigate to Directory > Federation and Social login, click Create, select LDAP Source, and click Next.
Provide a name and slug. Disable User password writeback, because JumpCloud's LDAP service is read-only. Configure the following settings:
Under Connection settings:
- Server URI:
ldaps://ldap.jumpcloud.com - Enable StartTLS: disabled
- Bind CN: the LDAP DN shown in the binding user's JumpCloud details
- Bind Password: the binding user's password
- Base DN:
ou=Users,o=<organization_id>,dc=jumpcloud,dc=com, using the Organization ID from JumpCloud
- Server URI:
Under LDAP Attribute mapping:
- User Property Mappings: select only
authentik default OpenLDAP Mapping: uid,authentik default OpenLDAP Mapping: cn, andauthentik default LDAP Mapping: mail. - Group Property Mappings: select only
authentik default OpenLDAP Mapping: cn.
- User Property Mappings: select only
Under Additional settings:
- User object filter:
(objectClass=inetOrgPerson) - Group object filter:
(objectClass=groupOfNames) - Object uniqueness field:
cn
- User object filter:
Click Finish.
Open the source, go to the Sync tab, and click Run sync again. Check that users, groups, and memberships synchronize successfully.
In Flows and Stages > Stages, edit the password stage used by your authentication flow. Ensure that User database + LDAP password is selected as a backend, then test logging in with a synchronized user's JumpCloud credentials.
Configure SCIM
JumpCloud must be able to reach your authentik SCIM endpoint over HTTPS.
Create the SCIM source in authentik
- Log in to authentik as an administrator and open the authentik Admin interface.
- Navigate to Directory > Federation and Social login, click Create, and select SCIM Source.
- Provide a Name, set the Slug to
jumpcloud, and click Finish. The slug is used in the SCIM Base URL in the next step. - Open the newly created source. Note the SCIM Base URL (
https://authentik.company/source/scim/jumpcloud/v2), then use Click to copy token to copy the bearer token. Both are required in the next section.
Configure JumpCloud provisioning
Create a custom SCIM integration in JumpCloud:
- Log in to the JumpCloud Admin Portal as an administrator.
- Navigate to Access > SSO Applications and click Add New Application.
- Select URL Bookmark.
- Set the display label to
authentikand the URL tohttps://authentik.company. Save and open the application. - Open the Provisioning tab and configure the following settings:
- Base URL:
https://authentik.company/source/scim/jumpcloud/v2 - Token: the bearer token copied from the authentik SCIM source.
- Test User Email: an email address that does not already exist in authentik.
- Base URL:
- Click Test Connection.
- After the connection succeeds, enable Enable management of User Groups and Group Membership in this application to provision groups and their memberships.
- Click Activate. JumpCloud creates, updates, and deletes a test user and group to validate provisioning.
- Open the application's User Groups tab and bind the groups whose members JumpCloud should provision into authentik. Confirm that the assigned users, groups, and memberships appear in authentik.
Users Sources Sources Protocols Kerberos Index (`website/docs/users-sources/sources/protocols/kerberos/index.mdx`)
title: Kerberos authentik_preview: true
This source allows users to enroll themselves with an existing Kerberos identity.
Preparation
The following placeholders are used in this guide:
REALM.COMPANYis the Kerberos realm.authentik.companyis the FQDN of the authentik installation.
Examples are shown for an MIT Krb5 KDC system; you might need to adapt them for your Kerberos installation.
There are three ways to use the Kerberos source:
- As a password backend, where users can log in to authentik with their Kerberos password.
- As a directory source, where users are synced from the KDC.
- With SPNEGO, where users can log in to authentik with their browser and their Kerberos credentials.
You can choose to use one or more of those methods.
Common settings
In the authentik Admin interface, under Directory > Federation and Social login, create a new source of type Kerberos with these settings:
- Name: a value of your choosing. This name is shown to users if you use the SPNEGO login method.
- Slug:
kerberos - Icon: Optional icon or image shown for the source. See File picker values.
- Realm:
REALM.COMPANY - Kerberos 5 configuration: If you need to override the default Kerberos configuration, you can do it here. See man krb5.conf(5) for the expected format.
- User matching mode: define how Kerberos users get matched to authentik users.
- Group matching mode: define how Kerberos groups (specified via property mappings) get matched to authentik groups.
- User property mappings and group property mappings: see Source property mappings and the section below for details.
Password backend
No extra configuration is required. Simply select the Kerberos backend in the password stage of your flow.
Note that this only works on users that have been linked to this source, i.e. they must have been created via sync or via SPNEGO.
Sync
The sync process uses the Kerberos V5 administration system to list users. Your KDC must support it to sync users with this source.
You need to create both a principal (a unique identity that represents a user or service in a Kerberos network) for authentik and a keytab file:
$ kadmin
> add_principal authentik/[email protected]
> ktadd -k /tmp/authentik.keytab authentik/[email protected]
> exit
$ cat /tmp/authentik.keytab | base64
$ rm /tmp/authentik.keytabIn authentik, configure these extra options:
- Sync users: enable it
- Sync principal:
authentik/[email protected] - Sync keytab: the base64-encoded keytab created above.
If you do not wish to use a keytab, you can also configure authentik to authenticate using a password or an existing credentials cache.
SPNEGO
You need to create both a principal (a unique identity that represents a user or service in a Kerberos network) for authentik and a keytab file:
$ kadmin
> add_principal HTTP/[email protected]
> ktadd -k /tmp/authentik.keytab HTTP/[email protected]
> exit
$ cat /tmp/authentik.keytab | base64
$ rm /tmp/authentik.keytabIn authentik, configure these extra options:
- SPNEGO keytab: the base64-encoded keytab created above.
If you do not wish to use a keytab, you can also configure authentik to use an existing credentials cache.
You can also override the SPNEGO server name if needed.
You might need to configure your web browser to allow SPNEGO. Check out our documentation on how to do so. You can now log in to authentik using SPNEGO.
Custom server name
If your authentik instance is accessed from multiple domains, you might want to force the use of a specific server name. You can do so with the Custom server name option. The value must be in the form of [email protected].
If not specified, the server name defaults to trying out all entries in the keytab/credentials cache until a valid server name is found.
Extra settings
There are some extra settings you can configure:
- Update internal password on login: when a user logs in to authentik using the Kerberos source as a password backend, their internal authentik password will be updated to match the one from Kerberos.
- Use password writeback: when a user changes their password in authentik, their Kerberos password is automatically updated to match the one from authentik. This is only available if synchronization is configured, and requires authentik to receive the raw password; hashed-password imports are not written back to Kerberos.
Kerberos source property mappings
See the overview for information on how property mappings work with external sources.
By default, authentik ships with pre-configured mappings for the most common Kerberos setups. These mappings can be found on the Kerberos Source Configuration page in the Admin interface.
Built-in property mappings
Kerberos property mappings are used when you define a Kerberos source. These mappings define which Kerberos property maps to which authentik property. By default, the following mappings are created:
- authentik default Kerberos User Mapping: Add realm as group
The realm of the user will be added as a group for that user. - authentik default Kerberos User Mapping: Ignore other realms
Realms other than the one configured on the source are ignored, and logging in is not allowed. - authentik default Kerberos User Mapping: Ignore system principals
System principals such asK/Morkadmin/adminare ignored. - authentik default Kerberos User Mapping: Multipart principals as service accounts
Multipart principals (for example:HTTP/authentik.company) have their user type set to service account.
These property mappings are configured with the most common Kerberos setups.
Expression data
The following variable is available to Kerberos source property mappings:
principal: a Python string containing the Kerberos principal. For example[email protected]orHTTP/[email protected].
When the property mapping is invoked from a SPNEGO context, the following variable is also available:
spnego_info: a Python dictionary with the following keys:initiator_name: the name of the initiator of the GSSAPI security contexttarget_name: the name of the target of the GSSAPI security contextmech: the GSSAPI mechanism used. Should always be Kerberosactual_flags: the flags set on the GSSAPI security context
When the property mapping is invoked from a synchronization context, the following variable is also available:
principal_obj: aPrincipalobject retrieved from the KAdmin API
Additional expression semantics
If you need to skip synchronization for a specific object, you can raise the SkipObject exception. To do so, create or modify a Kerberos property mapping to use an expression to define the object to skip.
Example:
localpart, realm = principal.rsplit("@", 1)
if localpart == "username":
raise SkipObjectTroubleshooting
You can start authentik with the KRB5_TRACE=/dev/stderr environment variable for Kerberos to print errors in the logs.
Reverse proxy caching can break the Kerberos authentication flow because, during negotiation, the server sends a second 401 Unauthorized response containing the WWW-Authenticate header that the client needs to continue the handshake; if the reverse proxy caches that 401 instead of forwarding it to authentik, the authentication process fails, so response caching should be disabled on any reverse proxy routes involved in Kerberos authentication.
Users Sources Sources Protocols Ldap Index (`website/docs/users-sources/sources/protocols/ldap/index.mdx`)
title: LDAP source
Sources allow you to connect authentik to an existing user directory. This source allows you to import users and groups from an LDAP server.
User and group synchronization only creates or updates objects in authentik, not on the LDAP server. User password writeback separately writes password changes to LDAP. Creating a user in an external LDAP directory from authentik requires custom automation, such as a notification rule expression policy.
:::info
For Active Directory, follow the Active Directory integration.
For FreeIPA, follow the FreeIPA integration.
:::
Configuration options for LDAP sources
To create or edit a source in authentik, open the Admin interface and navigate to Directory > Federation and Social login. There you can create a new LDAP source, or edit an existing one, using the following settings.
- Enabled: Toggle this option on to allow authentik to use the defined LDAP source.
- Update internal password on login: When the user logs in to authentik using the LDAP password backend, the password is stored as a hashed value in authentik. Toggle off (default setting) if you do not want to store the hashed passwords in authentik.
- Sync users: Enable or disable user synchronization from LDAP to authentik.
- User password writeback: Enable this option to write password changes made in authentik back to LDAP. authentik must receive the raw password; hashed-password imports are not written back. Only one LDAP source can have this option enabled. For Active Directory, this option allows authentik to run a local password complexity check when the domain-level
DOMAIN_PASSWORD_COMPLEXflag is set. - Sync groups: Enable or disable group synchronization from LDAP to authentik.
- Delete Not Found Objects: :ak-version[2025.6] This option synchronizes user and group deletions from LDAP sources to authentik. User deletion requires enabling Sync users and group deletion requires enabling Sync groups.
Connection settings
Server URI: URI to your LDAP server or domain controller. You can specify multiple servers by separating URIs with a comma, such as
ldap://ldap1.company,ldap://ldap2.company. When using a DNS entry with multiple records, authentik selects a random entry when first connecting.- Enable StartTLS: Enables StartTLS functionality. To use LDAPS instead, use port
636. - Use Server URI for SNI verification: this setting is required for servers using TLS 1.3+
- Enable StartTLS: Enables StartTLS functionality. To use LDAPS instead, use port
TLS Verification Certificate: Select a certificate/keypair containing the LDAP server CA chain to validate the remote certificate. Leave this field empty to skip certificate validation for LDAPS and StartTLS connections. Leaving it empty does not use the container or operating system trust store.
Service bind method: Authentication method used for synchronization, searches, and password writeback.
- Simple or anonymous bind: Use Bind CN and Bind Password for a simple bind. If both fields are empty, authentik performs an anonymous bind. This is the default and preserves the behavior of sources created before SASL EXTERNAL support was added.
- SASL EXTERNAL: Use the identity established by the TLS client certificate. This option requires TLS Client authentication certificate and either an
ldap://URI with Enable StartTLS selected or anldaps://URI with Enable StartTLS cleared. The LDAP server must trust and map the certificate to an identity with the required directory permissions.
TLS Client authentication certificate: Client certificate keypair presented to the LDAP server. This field is required for SASL EXTERNAL.
Bind CN: CN of the bind user. This can also be a UPN in the format of
[email protected]. SASL EXTERNAL ignores this field for service connections.Bind Password: Password used during the bind process. SASL EXTERNAL ignores this field for service connections.
Base DN: Base DN (distinguished name) used for all LDAP queries.
SASL EXTERNAL only changes the service connection. When a synchronized user signs in with an LDAP password, authentik still performs a simple bind as that user's distinguished name to verify the submitted password.
:::note Active Directory client certificate authentication
Active Directory supports SASL EXTERNAL after StartTLS. Configure an ldap:// URI and enable Enable StartTLS. Active Directory treats a client certificate presented directly over LDAPS as an implicit bind and rejects a subsequent SASL EXTERNAL bind.
:::
:::note TLS handshake failures
If the LDAP server rejects the TLS handshake, verify that Server URI, Enable StartTLS, and Use Server URI for SNI verification match the server configuration. You can also configure AUTHENTIK_LDAP__TLS__CIPHERS if the server requires a specific cipher suite.
:::
LDAP Attribute mapping
User Property Mappings and Group Property Mappings: Define which LDAP properties map to which authentik properties. The default set of property mappings is generated for Active Directory. See also our documentation on property mappings.
:::warning
When the Sync users and/or the Sync groups options are enabled, their respective property mapping options must have at least one mapping selected, otherwise the sync will not start.
:::
Additional settings
- Sync Group Parents: Sync group hierarchy from LDAP directories. Adds parents to groups imported from this LDAP directory, using same lookup fields and method as for user group membership.
- Additional Parent Group: Parent group for all the groups imported from LDAP. An example use case would be to import Active Directory groups under a root
imported-from-adgroup. - User path: Path template for all new users created.
- Additional User DN: Prepended to the base DN for user queries.
- Additional Group DN: Prepended to the base DN for group queries.
- User object filter: Consider objects matching this filter to be users.
- Group object filter: Consider objects matching this filter to be groups.
- Lookup using a user attribute: Acquire group membership from a User object attribute (
memberOf) instead of a Group attribute (member). This works with directories with nested group memberships (Active Directory, RedHat IDM/FreeIPA), usingmemberOf:1.2.840.113556.1.4.1941:as the group membership field. - Group membership field: The user object attribute or the group object attribute that determines the group membership for a user. If Lookup using a user attribute is set, this should be a user object attribute, otherwise a group object attribute.
- User membership attribute: Attribute name on authentik user objects that is checked against the Group membership field. Two common cases are:
- If your groups have
memberattributes containing DNs, set this todistinguishedName. (ThedistinguishedNameattribute for User objects in authentik is set automatically.) - If your groups have
memberUidattributes containinguids, set this touid. Make sure that you've created a property mapping that creates an attribute calleduid.
- If your groups have
- Object uniqueness field: This field contains a unique identifier.
LDAP source property mappings
See the overview for information on how property mappings work.
By default, authentik ships with pre-configured mappings for the most common LDAP setups. These mappings can be found on the LDAP Source Configuration page in the Admin interface.
You can assign the value of a mapping to any user attribute. Keep in mind, though, data types from the LDAP server will be carried over. This means that with some implementations, where fields are stored as an array in LDAP, they will be saved as an array in authentik. To prevent this, use the built-in list_flatten function. Here is an example mapping for the user's username and a custom attribute for a phone number:
return {
"username": ldap.get("uid"), # list_flatten is automatically applied to top-level attributes
"attributes": {
"phone": list_flatten(ldap.get("phoneNumber")), # but not for attributes!
},
}The same LDAP source property mapping type is used for both users and groups. A mapping only applies to groups when you assign it under Group Property Mappings on the LDAP source. If you only use the built-in group property mappings, synced groups will keep the automatically populated LDAP attributes, such as distinguishedName, but custom LDAP attributes won't be copied unless you add your own group mapping.
Copy a custom LDAP group attribute
To store a custom LDAP group attribute in authentik's group attributes, create an LDAP Source Property Mapping and assign it to Group Property Mappings on the source:
return {
"attributes": {
"acl": list_flatten(ldap.get("acl")),
},
}If your LDAP server stores the value as JSON text and you want authentik to keep it as structured data instead of a string, decode it in the mapping:
import json
raw_acl = list_flatten(ldap.get("acl"))
return {
"attributes": {
"acl": json.loads(raw_acl) if raw_acl else None,
},
}Built-in property mappings
LDAP property mappings are used when you define an LDAP source. These mappings define which LDAP property maps to which authentik property. By default, the following mappings are created:
authentik default Active Directory Mapping: givenNameauthentik default Active Directory Mapping: sAMAccountNameauthentik default Active Directory Mapping: snauthentik default Active Directory Mapping: userPrincipalNameauthentik default LDAP Mapping: mailauthentik default LDAP Mapping: Nameauthentik default OpenLDAP Mapping: cnauthentik default OpenLDAP Mapping: uid
These are configured for most common LDAP setups.
Expression data
The following variables are available to LDAP source property mappings:
ldap: A Python dictionary containing data from LDAP.dn: The object DN.
Additional expression semantics
If you need to skip inbound synchronization for a specific user or group, you can raise the SkipObject exception. To do so, create or modify an LDAP property mapping to use an expression to define the object to skip.
:::noteSkipObject only affects inbound synchronization. It does not control password writeback or custom LDAP writes from notification policies.
:::
Example:
if ldap.get("cn") == "doNotSync":
raise SkipObjectPassword login
By default, authentik doesn't update the password it stores for a user when they log in using their LDAP credentials. That means that if the LDAP server is not reachable by authentik, users will not be able to log in. This behavior can be turned on with the Update internal password on login setting on the LDAP source.
:::info
Sources created prior to the 2024.2 release have this setting turned on by default.
:::
Be aware of the following security considerations when turning on this functionality:
- Updating the LDAP password does not invalidate the password stored in authentik; however for LDAP Servers like FreeIPA and Active Directory, authentik will lock its internal password during the next LDAP sync. For other LDAP servers, the old passwords will still be valid indefinitely.
- Logging in via LDAP credentials overwrites the password stored in authentik if users have different passwords in LDAP and authentik.
- Custom security measures that are used to secure the password in LDAP may differ from the ones used in authentik. Depending on threat model and security requirements this could lead to unknowingly being non-compliant.
Active Directory password complexity
authentik applies a local approximation of Microsoft's password complexity requirements rules to Password fields in a prompt stage when:
- The LDAP source is enabled and has User password writeback enabled.
- The domain root's
pwdPropertiesincludes theDOMAIN_PASSWORD_COMPLEXflag. If thepwdPropertieslookup returns no usable value, authentik skips the check. - The pending user, if any, has a
distinguishedNameattribute. When no user is pending, such as during enrollment, authentik still checks the character categories but does not perform thesAMAccountNameordisplayNamechecks.
For a pending user with a distinguishedName attribute, authentik performs two case-insensitive checks:
- The password must not contain the complete
sAMAccountNamewhen the account name is at least three characters long. - The password must not contain a
displayNametoken that is at least three characters long. authentik splitsdisplayNameon commas, periods, hyphens, underscores, spaces, number signs (#), and tabs.
The password must also contain characters from at least three of the following categories:
- Uppercase letters
- Lowercase letters
- Digits
- Symbols:
~!@#$%^&*_-+=`|\(){}[]:;"'<>,.?/ - Non-ASCII alphabetic characters
If the check fails, the user sees:
Password does not match Active Directory Complexity.The check runs before the prompt stage's validation policies. If it fails, authentik does not evaluate those policies.
:::note
authentik performs this check locally without asking Active Directory to evaluate the password. It does not evaluate minimum password length, password history, minimum password age, or the user's effective fine-grained policy. Active Directory evaluates its effective policy during password writeback and can reject a password that passes this check. To enforce additional requirements in authentik, bind a password policy to the prompt stage.
:::
Troubleshooting
To troubleshoot LDAP sources and their synchronization, see LDAP Troubleshooting.
Users Sources Sources Protocols Oauth Index (`website/docs/users-sources/sources/protocols/oauth/index.mdx`)
title: OAuth source
This source allows users to enroll themselves with an external OAuth-based identity provider. The generic provider expects the endpoint to return OpenID Connect-compatible information. Vendor-specific implementations have their own OAuth source.
Policies: Allow/Forbid users from linking their accounts with this provider.
Icon: Optional icon or image shown for the source. See File picker values.
Request Token URL: This field is used for OAuth v1 implementations and will be provided by the provider.
Authorization URL: This value will be provided by the provider.
Access Token URL: This value will be provided by the provider.
Profile URL: This URL is called by authentik to retrieve user information upon successful authentication.
Consumer key/Consumer secret: These values will be provided by the provider.
Scopes: Configure additional scopes to send to the provider.
Starting with authentik 2022.10, the default scopes can be replaced by prefixing the value for scopes with
*.
OpenID Connect
Well-known
Instead of configuring the URLs for a source manually, if the application you're configuring implements the OpenID Connect Discovery Spec, you can configure the source with a single URL. The URL should always end with .well-known/openid-configuration. Many applications don't explicitly mention this URL, but for most of them it will be https://application.company/.well-known/openid-configuration.
This URL is fetched upon saving the source, and all the URLs will be replaced by the ones from the Discovery document. No automatic re-fetching is done.
JWKS
To simplify machine-to-machine authentication, you can create an OAuth source as a trusted source of JWTs. Create a source and configure either the Well-known URL or the OIDC JWKS URL. You can also manually enter the JWKS data.
Afterward, this source can be selected in one or more OAuth 2.0 providers. Any JWT issued by the configured source's JWKS can authenticate. To learn more about this, see JWT authentication.
`login_hint` parameter
If the OAuth authentication was started from within an authentik flow and the user has already identified themselves, authentik will set the login_hint parameter to the email address of the user. If the Identification stage has the Pretend user exists option enabled and a user could not be found, the login_hint value will be set to the identifier that the user entered.
OAuth source property mappings
See the overview for information on how property mappings work.
Expression data
The following variables are available to OAuth source property mappings:
info: A Python dictionary containing OAuth claims. For example (values might differ depending on the source):python{ "iss": "https://source.company", "sub": "f153e7da687eec8c8789c72b6cc6bb5197df7b48b263b3151f36908e1bc10691", "aud": "01e4DmQiG1d3kaewD3Mkz7E7kXknk9j43eZMkNaE", "aud": "a7809c1b1c4aaa50adfb68660a6273dd9c8d15e4", "email": "[email protected]", "email_verified": True, "name": "User", "given_name": "User", "preferred_username": "user", "nickname": "user", }client: The OAuth client for this login. Callclient.do_request(method, url, token=token, **kwargs)to make an authenticated request to the identity provider. It accepts request options such asparamsandheadersand returns arequests.Response. Callraise_for_status()before reading the response if an API error should stop the mapping.token: A Python dictionary containing the OAuth tokens for this login. Pass it toclient.do_requestwhen making an authenticated request.
For example, a user property mapping can retrieve a field that the profile response does not include:
response = client.do_request("GET", "https://source.company/api/user", token=token)
response.raise_for_status()
return {"attributes": {"department": response.json().get("department")}}Replace the URL and response field with values from your identity provider's API. For a working provider-specific example, see GitHub organization membership.
Users Sources Sources Protocols Saml Index (`website/docs/users-sources/sources/protocols/saml/index.mdx`)
title: SAML source
This source allows authentik to act as a SAML service provider. Like the SAML provider, it supports signed requests. Vendor-specific documentation is available in the integrations section.
Terminology
| Abbreviation | Name | Description |
|---|---|---|
| IdP | Identity provider | The authoritative SAML authentication source that holds the user database. |
| SP | Service provider | The client that is connected to an IdP, usually providing a service, such as a web application. In the current context, authentik is the SP. |
| - | Assertion | A message sent by the IdP asserting that the user has been identified. |
| ACS | Assertion Consumer Service | The service on the SP side that consumes the assertion sent from the IdP. |
| SSO URL | Single sign-on URL | The URL on the IdP side that the SP calls to initiate an authentication process. |
| SLO URL | Single logout URL | The URL on the IdP side that the SP calls to invalidate a session and log the user out of the IdP and the SP. |
Example configuration
If you have the provider metadata, you can extract the values that you need from it. The following table provides example values for a basic IdP metadata file.
| Name | Example | Description |
|---|---|---|
| Name | Company SAML | The name of the authentication source |
| Slug | company-saml | The slug used in URLs for the source |
| Icon | branding/company-icon.svg |
Optional icon or image shown for the source. See File picker values. |
| SSO URL | https://saml.company/login/saml | The SingleSignOnService URL for the IdP. This value can be found in the metadata or IdP documentation. There can be different URLs for different binding types, such as HTTP-Redirect and HTTP-POST. Use the URL for the binding type that you choose below. |
| SLO URL | https://saml.company/logout/saml | The URL that is called when a user logs out of authentik. This can be used to automatically log the user out of the SAML IdP after logging out of authentik. Not all IdPs support or require this behavior. |
| Binding Type | HTTP-POST | How authentik communicates with the SSO URL (302 redirect or POST request). This will depend on what the provider supports. |
| Allow IdP-initiated logins | False | Whether to allow the IdP to log users into authentik without any interaction. Activating this can be a security risk because this request is not verified, and could be used by an attacker to authenticate a user without interaction. |
| Force authentication | False | When enabled, authentik requests the IdP to force re-authentication of the user, even if they already have an active session with the IdP. |
| Issuer override | https://authentik.company/source/saml//metadata/ |
The identifier (Entity ID) for the authentik instance in the SAML federation. This is optional and defaults to the metadata URL of the source, as shown in the example. To override it, set any value that the IdP recognizes. This must match what you register on the IdP side. |
| NameID Policy | Persistent | Depending on what the IdP sends as persistent ID, some IdPs use the username or email address while others use a random string or hashed value. If the user in authentik receives a random string as a username, try using Email address or Windows. |
| Flow settings | Default | If there are custom flows in your instance for external authentication, select them here. |
Transient users and account lifetime
When the IdP sends a transient NameID, authentik creates a temporary user linked to the SAML source. This is determined by the NameID format in the assertion, even if the source's NameID Policy requests another format.
Temporary users are deleted:
- when they log out of authentik, or
- by a cleanup task after they expire.
The Delete temporary users after setting determines the expiration time from account creation. The default is days=1; you can set values such as hours=8 or hours=1;minutes=30. This setting does not delay deletion on logout. Cleanup tasks run periodically, rather than at the exact expiration time, and do not check for active sessions, so an expired temporary user can be deleted while still logged in.
Mapping a transient user's username or email to a stable value does not make the account persistent or prevent deletion.
Use Persistent NameIDs when users need to keep the same authentik account across logins. Configure the IdP to send a stable persistent NameID and set the source's NameID Policy to Persistent. authentik uses the NameID to find the existing source connection on subsequent logins.
Add authentik as a service provider with your IdP
This depends on the software that you use for your IdP. On the Metadata tab in the SAML federation source, you can download the metadata for the service provider. This should let you import the service provider into most IdPs. If this does not work, the important parts are:
- Entity ID: Taken from the Issuer override field above
- Return URL/ACS URL:
https://authentik.company/source/saml//acs/ - Certificate: If you have chosen to sign your outgoing requests, use the public side of the certificate that you specified in the settings.
Example IdP metadata
/* Detailed source-code truncated for AI context efficiency. */SAML source property mappings
See the overview for information on how property mappings work.
SAML source property mappings customize the user and group properties created from a SAML assertion. authentik parses the assertion's AttributeStatement into the properties dictionary before custom mappings run, using each SAML attribute's Name as the dictionary key. Custom mappings can then translate those SAML attribute names to authentik user fields such as username, email, name, and attributes.
Property mappings do not change the internal SAML source connection identifier, which is based on the assertion's NameID. To persist mapped user fields, ensure the source flow that runs for the user includes a User Write stage before the user login stage. For existing users, this is the source's authentication flow; for new users, this is the source's enrollment flow.
Expression data
The following variables are available to SAML source property mappings:
The parsed XML objects use Python's standard xml.etree.ElementTree API.
root: The parsed XML root containing data from the source.assertion: The parsed XML element containing the SAML assertion.name_id: The parsed XML element identifying the user.properties: A Python dictionary containing the source's parsed SAML attributes and the results of any previously run mappings.
Example
This example maps common SAML attributes to authentik user fields. Replace the attribute names with the SAML attribute Name values sent by the external identity provider connected to this SAML source.
email = properties.get("email") or properties.get("urn:oid:0.9.2342.19200300.100.1.3")
first_name = properties.get("firstname") or properties.get("urn:oid:2.5.4.42")
last_name = properties.get("lastname") or properties.get("urn:oid:2.5.4.4")
return {
"username": email,
"email": email,
"name": f"{first_name or ''} {last_name or ''}".strip(),
"attributes": {
"first_name": first_name,
"last_name": last_name,
},
}If you need to read the XML assertion directly, use the SAML assertion namespace when searching for elements:
NS_SAML_ASSERTION = "urn:oasis:names:tc:SAML:2.0:assertion"
attributes = {}
for attribute in assertion.findall(f".//{{{NS_SAML_ASSERTION}}}Attribute"):
values = [
value.text
for value in attribute.findall(f"{{{NS_SAML_ASSERTION}}}AttributeValue")
]
attributes[attribute.attrib["Name"]] = values[0] if len(values) == 1 else values
return {
"email": attributes.get("email"),
}Users Sources Sources Protocols Scim Index (`website/docs/users-sources/sources/protocols/scim/index.mdx`)
title: SCIM source
The SCIM source allows other applications to directly create users and groups within authentik. SCIM provides a predefined schema for users and groups, along with a RESTful API, to enable automatic user provisioning and deprovisioning. SCIM is supported by applications such as Microsoft Entra ID, Google Workspace, and Okta.
The base SCIM URL is in the format of https://authentik.company/source/scim//v2. Authentication is done via Bearer tokens that are generated by authentik. When an SCIM source is created, a service account is created and a matching token is provided.
First steps
To set up an SCIM source, log in to authentik as an administrator. Navigate to Directory > Federation and Social login and click Create. Select the SCIM Source type and give the source a name.
After the source is created, click the name of the source in the list. The page displays the SCIM Base URL that is used by the SCIM client. Use the Click to copy token button to copy the token that the client uses to authenticate SCIM requests.
Supported options and resource types
`/v2/Users`
Endpoint to list, create, update, and delete users.
`/v2/Groups`
Endpoint to list, create, update, and delete groups.
There are also /v2/ServiceProviderConfig and /v2/ResourceTypes, which are used by SCIM-enabled applications to find out which features authentik supports.
Trust model and security
The SCIM source Bearer token is a high-trust provisioning credential. Anyone who can use the token can manage users and groups through the SCIM endpoints for that source. Treat it like a secret with roughly the same sensitivity as an administrative provisioning integration, not like a narrowly scoped API key.
By default, authentik applies the following behavior for inbound SCIM requests:
User and group correlation
On create and update, authentik can correlate SCIM resources to existing directory objects in the same tenant:
- Users are matched by
userNameacross the entire tenant, not only users already linked to this SCIM source. - Groups are matched by
displayName(mapped to the groupname) across the entire tenant, not only groups already linked to this SCIM source.
If a matching object exists, the SCIM source adopts and updates that object.
Group membership
Group members operations accept any user UUID in the tenant. authentik does not require that member users were originally created by, or are exclusively managed by, the same SCIM source.
Deprovisioning (DELETE)
SCIM DELETE on a user or group removes the underlying authentik User or Group object, not only the SCIM source link. This applies to correlated objects as well as objects created through SCIM.
Default bootstrap layout
Fresh installs create a superuser group named authentik Admins (is_superuser=true) and an initial admin user. Because group correlation is tenant-wide, a SCIM token holder can interact with that group if they use the same displayName, including changing membership or deleting the group after correlating to it.
Recommendations
- Restrict network access to SCIM endpoints where possible.
- Rotate and revoke SCIM tokens when an IdP integration is decommissioned.
- Do not share SCIM tokens across untrusted systems.
SCIM source property mappings
See the overview for information on how property mappings work.
Expression data
Each top-level SCIM attribute is available as a variable in the expression. For example, given a SCIM request with the payload of
{
"schemas": [
"urn:scim:schemas:core:2.0",
"urn:scim:schemas:extension:enterprise:2.0"
],
"userName": "foo.bar",
"name": {
"familyName": "bar",
"givenName": "foo",
"formatted": "foo.bar"
},
"emails": [
{
"value": "[email protected]",
"type": "work",
"primary": true
}
],
"title": "",
"urn:scim:schemas:extension:enterprise:2.0": {
"department": ""
}
}The following variables are available in the expression:
schemasas a list of stringsuserNameas a stringnameas a dictionaryemailsas a dictionarytitleas a stringurn_scim_schemas_extension_enterprise_2_0as a dictionary:::info
Top-level keys that include symbols not allowed in Python syntax are converted to_.
:::
Users Sources Sources Social Logins Apple Index (`website/docs/users-sources/sources/social-logins/apple/index.mdx`)
title: Log in with Apple
sidebar_label: Apple
tags:
- source
- apple
This source lets users authenticate with their Apple ID credentials by configuring Apple as a federated identity provider with OAuth 2.0.
Preparation
The following placeholders are used in this guide:
Apple mandates the use of a registered top-level domain, therefore this source will not work with .local and other non-public TLDs.
Apple configuration
To integrate Apple with authentik, you need to register two identifiers and a key in the Apple Developer Portal.
Register identifiers
Log in to the Apple Developer Portal, and navigate to Account > Certificates, IDs & Profiles, then click Identifiers in the sidebar.
Register a new identifier with the type of App IDs, and the subtype App.
Choose a name that users will recognize for the Description field (e.g.
authentik).For your Bundle ID, use the reverse of your authentik domain, for example:
company.authentik.Scroll down the list of capabilities, and check the box next to Sign In with Apple.
At the top, click Continue and Register.
Register another new identifier with the type of Services IDs.
Again, choose the same name as above for your Description field.
Use the same identifier as above, but add a suffix like
signinoroauth, as identifiers are unique.At the top, click Continue and Register.
Configure an identifier
- After you return to the overview list, click the identifier that you created.
- Enable the checkbox next to Sign In with Apple, and click Configure
- Under Domains and Subdomains, enter
authentik.company. - Under Return URLs, enter
https://authentik.company/source/oauth/callback/apple/.
Register a key
Click Keys in the sidebar, then register a new key with any name, and select Sign in with Apple.
Click Configure, then select the App ID that you created.
At the top, click Save, Continue and Register.
Download the Key file and note the Key ID.
Take note of the Team ID visible at the top of the page.
authentik configuration
To support the integration of Apple with authentik, you need to create an Apple OAuth source in authentik.
Log in to authentik as an administrator and open the authentik Admin interface.
Navigate to Directory > Federation and Social login, click New Source, then configure the following settings:
- Select type: select Apple OAuth Source.
- Create Apple OAuth Source: provide a name, a slug that must match the slug used in the Apple
Return URL, and the following required configurations:- Under Protocol Settings:
- Consumer key: The identifier from step 9, then
;, then your Team ID from step 19, then;, then the Key ID from step 18. (e.g.company.authentik;JQNH45HN7V;XFBNJ82BV6). - Consumer secret: Paste the contents of the keyfile you've downloaded.
- Scopes (optional): define any further access scopes.
- Consumer key: The identifier from step 9, then
- Under Protocol Settings:
Click Save.
:::info Display new source on login screen
For instructions on how to display the new source on the authentik login page, refer to the Add sources to default login page documentation.
:::
:::info Embed new source in flow :ak-enterprise
For instructions on embedding the new source within a flow, such as an authorization flow, refer to the Source Stage documentation.
:::
Source property mappings
Source property mappings allow you to modify or gather extra information from sources. See the overview for more information.
Users Sources Sources Social Logins Auth0 Index (`website/docs/users-sources/sources/social-logins/auth0/index.mdx`)
title: Log in with Auth0 sidebar_label: Auth0 tags: [source, auth0, saml, oidc]
import TabItem from "@theme/TabItem";
import Tabs from "@theme/Tabs";
This source lets users authenticate with their Auth0 credentials by configuring Auth0 as a federated identity provider using SAML or OpenID Connect (OIDC).
Preparation
The following placeholders are used in this guide:
authentik.companyis the FQDN of the authentik installation.company.auth0.comis the domain of your Auth0 tenant.<auth0-slug>is the slug of the source in authentik (for example,auth0).
Configuration methods
You can integrate Auth0 with authentik using either SAML or OpenID Connect (OIDC). Select a tab below for the corresponding instructions.
<Tabs
defaultValue="saml"
values={[
{ label: "SAML", value: "saml" },
{ label: "OIDC", value: "oidc" },
]}
SAML
Export the authentik signing certificate
Auth0 needs the public certificate of an authentik keypair to verify signed requests from authentik and to encrypt assertions.
- Log in to authentik as an administrator and open the authentik Admin interface.
- Navigate to System > Certificates.
- Click the certificate that you want to use for signing and encryption, for example, the default
authentik Self-signed Certificate. - Click Download Certificate.
To encrypt assertions, Auth0 requires the public key in a separate file in addition to the certificate. The certificate already contains the public key. Use the following OpenSSL command to extract it into a separate file.
openssl x509 -in authentik\ Self-signed\ Certificate_certificate.pem -pubkey -noout > public_key.pemAuth0 configuration
Create an application with the SAML2 Web App addon
Log in to the Auth0 Dashboard as an administrator.
Navigate to Applications > Applications and click Create Application.
Set the name to
authentik, select Regular Web Applications, and click Create.On the Settings tab, take note of the Client ID. This value will be required when configuring encryption.
Navigate to the Addons tab and enable SAML2 Web App.
On the addon's Settings tab, configure the following settings:
- Application Callback URL:
https://authentik.company/source/saml/<auth0-slug>/acs/ - Settings: paste the following JSON. Replace the
signingCertvalue with the contents of the authentik certificate that you exported earlier. Format the certificate as a single line by replacing each line break with\n. Auth0 uses this certificate to verify signatures on requests from authentik.
json showlinenumbers{ "audience": "https://authentik.company/source/saml/<auth0-slug>/metadata/", "nameIdentifierFormat": "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent", "signatureAlgorithm": "rsa-sha256", "digestAlgorithm": "sha256", "mappings": { "email": "email" }, "signingCert": "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----\n" }- Application Callback URL:
Click Enable to save the addon settings.
On the addon's Usage tab, take note of the Identity Provider Login URL, and then click Download Auth0 certificate. You will need the URL and certificate to configure authentik.
Configure assertion encryption
Auth0 encrypts assertions using a post-login Action rather than an addon setting.
Navigate to Actions > Library and click Create Action > Create custom action.
Set the name to
SAML encryption, set Trigger toLogin / Post Login, and click Create.Paste the following code. Replace
<client_id>with the Client ID of the application that you created earlier. Replace the example certificate and public key with the contents of the files that you exported earlier:javascript showlinenumbersexports.onExecutePostLogin = async (event, api) => { if (event.client.client_id === "<client_id>") { const encryptionCert = `-----BEGIN CERTIFICATE----- ... -----END CERTIFICATE-----`; const encryptionPublicKey = `-----BEGIN PUBLIC KEY----- ... -----END PUBLIC KEY-----`; api.samlResponse.setEncryptionCert(encryptionCert); api.samlResponse.setEncryptionPublicKey(encryptionPublicKey); api.samlResponse.setEncryptionAlgorithm("aes256-gcm"); } };Click Deploy.
Navigate to Actions > Triggers and select post-login.
Drag the
SAML encryptionAction into the flow and click Apply.
authentik configuration
Upload the Auth0 certificate to authentik
- Log in to authentik as an administrator and open the authentik Admin interface.
- Navigate to System > Certificates and click Import.
- Set Name to
Auth0 Signing Certificateor similar. - Paste the contents of the Auth0 certificate you downloaded earlier into the Certificate field.
- Leave the Private Key field empty.
- Click Create.
Create a SAML source in authentik
- Navigate to Directory > Federation and Social login and click New Source.
- Select SAML Source and configure the following settings:
- Set Name to
Auth0. - Set Slug to
auth0. - Set SSO URL to the Identity Provider Login URL from Auth0 (
https://company.auth0.com/samlp/<client_id>). - Set SLO URL to the Identity Provider Login URL with
/logoutappended (https://company.auth0.com/samlp/<client_id>/logout). - Set Service Provider Binding to
Post (Auto-Submit). - Set Signing keypair to the authentik certificate you exported earlier.
- Set Verification Certificate to the Auth0 certificate you uploaded earlier.
- Enable Verify Assertion Signature.
- Under Advanced protocol settings, set Encryption Certificate to the authentik certificate you exported earlier. Its private key is used to decrypt the assertions encrypted by Auth0.
- Set Name to
- Click Finish.
OIDC
Auth0 configuration
To integrate Auth0 with authentik, create an application in the Auth0 Dashboard.
- Log in to the Auth0 Dashboard as an administrator.
- Navigate to Applications > Applications and click Create Application.
- Set the name to
authentik, select Regular Web Applications, and click Create. - On the Settings tab, take note of the Client ID and Client Secret values. You will need these values to configure authentik.
- Under Application URIs, set Allowed Callback URLs to
https://authentik.company/source/oauth/callback/<auth0-slug>/. - Click Save Changes.
authentik configuration
Create an Auth0 OpenID Connect source in authentik.
Log in to authentik as an administrator and open the authentik Admin interface.
Navigate to Directory > Federation and Social login and click New Source.
Select OpenID Connect OAuth Source and configure the following settings:
- Set Name to
Auth0. - Set Slug to
<auth0-slug>. Typically this isauth0. - Under Protocol settings:
- Set Consumer key to the Client ID from Auth0.
- Set Consumer secret to the Client Secret from Auth0.
- Under URL settings:
- Set OIDC Well-known URL to
https://company.auth0.com/.well-known/openid-configuration.
- Set OIDC Well-known URL to
- Set Name to
Click Finish.
authentik discovers the authorization, token, user info, and JWKS endpoints from the well-known URL, so you do not need to enter them individually.
:::info Display new source on login screen
For instructions on how to display the new source on the authentik login page, refer to the Add sources to default login page documentation.
:::
:::info Embed new source in flow :ak-enterprise
For instructions on embedding the new source within a flow, such as an authorization flow, refer to the Source Stage documentation.
:::
Source property mappings
Source property mappings allow you to modify or gather extra information from sources. See the overview for more information.
Resources
- Auth0 Docs — Configure Auth0 as SAML Identity Provider
- Auth0 Docs — Sign and Encrypt SAML Requests
- Auth0 Docs — Customize SAML Assertions
- Auth0 Docs — Authentication API Endpoints
Users Sources Sources Social Logins Cas Index (`website/docs/users-sources/sources/social-logins/cas/index.mdx`)
title: Log in with Apereo CAS sidebar_label: Apereo CAS tags: [source, cas, Apereo CAS, Apereo]
This source lets users authenticate with their Apereo CAS credentials by configuring CAS as a federated identity provider with OpenID Connect.
:::info
authentik does not support the native CAS protocol as a source. This guide uses the OpenID Connect provider that CAS ships in its cas-server-support-oidc module, so your CAS deployment must include that module.
:::
Preparation
The following placeholders are used in this guide:
authentik.companyis the FQDN of the authentik installation.cas.companyis the FQDN of the CAS installation.cas-slugis the slug to assign to the OAuth source in authentik (for example,cas).
This guide assumes CAS is served under the default /cas context path, so its OpenID Connect endpoints are below https://cas.company/cas/oidc/.
CAS configuration
Enable the OpenID Connect provider
Add the following to your CAS configuration, typically /etc/cas/config/cas.properties.
cas.authn.oidc.core.issuer=https://cas.company/cas/oidc
# CAS generates this keystore on first start if it does not already exist.
cas.authn.oidc.jwks.file-system.jwks-file=file:/etc/cas/oidc/keystore.jwks
# Required for authentik. See the note below.
cas.authn.oauth.core.user-profile-view-type=FLAT:::caution User profile view typecas.authn.oauth.core.user-profile-view-type defaults to NESTED, which wraps every claim in an attributes object:
{ "sub": "casuser", "attributes": { "email": "casuser@company", "name": "CAS User" } }authentik reads claims from the top level of the user info response, so with the default it finds only sub, and users are enrolled with an empty email and name. Setting the value to FLAT emits the claims where authentik expects them.
:::
Release attributes to authentik
CAS only sends the claims that a service is explicitly allowed to receive, and it can only send attributes that the principal actually has. If your CAS deployment resolves users from LDAP or a database, make sure the attributes you want are resolved under the names of the OpenID Connect claims that carry them: email for the email scope, and name and preferred_username for the profile scope.
For a test deployment that uses the static account handler, you can define the attributes directly:
cas.authn.attribute-repository.stub.attributes.name=CAS Demo User
cas.authn.attribute-repository.stub.attributes.preferred_username=casuser
cas.authn.attribute-repository.stub.attributes.email=casuser@companyRegister authentik as a relying party
Create a JSON service definition in your CAS service registry directory, typically /etc/cas/services. The file name must be <name>-.json and match the name and id fields inside it.
{
"@class": "org.apereo.cas.services.OidcRegisteredService",
"clientId": "authentik",
"clientSecret": "<a secret you generate>",
"serviceId": "^https://authentik\\.company/source/oauth/callback/cas-slug/?.*",
"name": "authentik",
"id": 1001,
"description": "authentik OAuth source delegating authentication to CAS",
"bypassApprovalPrompt": true,
"scopes": ["java.util.HashSet", ["openid", "profile", "email"]],
"supportedResponseTypes": ["java.util.HashSet", ["code"]],
"supportedGrantTypes": ["java.util.HashSet", ["authorization_code"]],
"attributeReleasePolicy": {
"@class": "org.apereo.cas.services.ChainingAttributeReleasePolicy",
"policies": [
"java.util.ArrayList",
[
{ "@class": "org.apereo.cas.oidc.claims.OidcProfileScopeAttributeReleasePolicy" },
{ "@class": "org.apereo.cas.oidc.claims.OidcEmailScopeAttributeReleasePolicy" }
]
]
}
}serviceId is a regular expression that CAS matches against the callback URL, so the dots in the hostname are escaped and the slug must match the slug you give the source in authentik. Without attributeReleasePolicy, CAS authenticates the user but releases no claims beyond sub.
Restart CAS so it picks up the configuration and the new service definition.
authentik configuration
To support the integration of CAS with authentik, you need to create an OpenID Connect OAuth source in authentik.
Log in to authentik as an administrator and open the authentik Admin interface.
Navigate to Directory > Federation and Social login, click New Source, and then configure the following settings:
- Select type: select OpenID Connect OAuth Source as the source type.
- Create OpenID Connect OAuth Source: provide a name, a slug that must match the slug used in the
serviceIdexpression (for example,cas), and the following required settings:- Under Protocol settings:
- Consumer key: enter the
clientIdfrom the CAS service definition. - Consumer secret: enter the
clientSecretfrom the CAS service definition.
- Consumer key: enter the
- Under URL settings:
- OIDC Well-known URL:
https://cas.company/cas/oidc/.well-known/openid-configuration
- OIDC Well-known URL:
- Under Protocol settings:
Click Finish to save your settings.
authentik reads the authorization, token, user info, and JWKS URLs from the well-known URL, so you do not need to enter them individually.
:::info Display new source on login screen
For instructions on how to display the new source on the authentik login page, refer to the Add sources to default login page documentation.
:::
:::info Embed new source in flow :ak-enterprise
For instructions on embedding the new source within a flow, such as an authorization flow, refer to the Source Stage documentation.
:::
Troubleshooting
- Application Not Authorized to Use CAS: CAS did not load a service definition matching the callback URL. Check that the
serviceIdexpression matcheshttps://authentik.company/source/oauth/callback/<cas-slug>/, that the file name matches thenameandidfields, and that the JSON parses. A service file that fails to deserialize, for example because of a misspelled@classvalue, is skipped, and CAS reports this error as though the service were never registered. - Users are enrolled with an empty email and name: CAS is returning nested claims. Set
cas.authn.oauth.core.user-profile-view-typetoFLAT. - Only
subis returned: the service definition has noattributeReleasePolicy, or the principal has no attributes to release. Setlogging.level.org.apereo.cas.services=debugincas.propertiesand check the CAS log for the "Final collection of attributes allowed are" entry, which shows what CAS resolved and released.
Resources
- Apereo CAS Docs — OpenID Connect Authentication
- Apereo CAS Docs — Attribute Release Policies
- Apereo CAS Docs — JSON Service Registry
Users Sources Sources Social Logins Discord Index (`website/docs/users-sources/sources/social-logins/discord/index.mdx`)
title: Log in with Discord
sidebar_label: Discord
tags:
- source
- discord
This source lets users authenticate with their Discord credentials by configuring Discord as a federated identity provider with OAuth 2.0.
Preparation
The following placeholders are used in this guide:
authentik.companyis the FQDN of the authentik installation.
Discord configuration
To integrate Discord with authentik, create an OAuth application in the Discord Developer Portal.
- Log in to the Discord Developer Portal.
- Navigate to Applications and click New Application.
- Provide a name for the application, accept the terms, and then click Create.
- Select OAuth2 in the sidebar.
- Under Client Secret, click Reset Secret and follow the steps.
- Take note of the Client ID and Client Secret. They will be required in the next section.
- Click Add Redirect and enter
https://authentik.company/source/oauth/callback/discord/.
authentik configuration
Log in to authentik as an administrator and open the authentik Admin interface.
Navigate to Directory > Federation and Social login, click New Source, and then configure the following settings:
- Select type: select Discord OAuth Source as the source type.
- Create Discord OAuth Source: provide a name, a slug that must match the slug used in the Discord
Redirect URI(e.g.discord), and the following required configurations:- Under Protocol Settings:
- Consumer key: set the Client ID from Discord.
- Consumer secret: set the Client Secret from Discord.
- Scopes (optional): if you need authentik to sync guild membership information from Discord, add the
guilds guilds.members.readscope.
- Under Protocol Settings:
Click Save.
:::info Display new source on login screen
For instructions on how to display the new source on the authentik login page, refer to the Add sources to default login page documentation.
:::
:::info Embed new source in flow :ak-enterprise
For instructions on embedding the new source within a flow, such as an authorization flow, refer to the Source Stage documentation.
:::
Optional additional configuration
Sync Discord roles and avatars to authentik
This mapping reads the user's role IDs in one Discord guild, links matching authentik groups, and stores an avatar URL. authentik reconciles source-linked group memberships after successful logins.
Before creating the mapping, add guilds guilds.members.read under Protocol settings > Scopes on the Discord OAuth source. For each authentik group to link, set an attribute named discord_role_id to its Discord role ID under Directory > Groups > Your group > Attributes. Enable Discord developer mode to copy the guild and role IDs.
- In the authentik Admin interface, navigate to Customization > Property Mappings.
- Click Create, select OAuth Source Property Mapping, and then click Next.
- Provide a name for the mapping and enter this expression. Replace the guild ID with your own.
from authentik.core.models import Group
guild_id = "123456789123456789"
guild_url = f"https://discord.com/api/v10/users/@me/guilds/{guild_id}/member"
response = client.do_request("GET", guild_url, token=token)
if response.status_code == 404:
is_member = False
role_ids = []
else:
response.raise_for_status()
is_member = True
role_ids = response.json()["roles"]
groups = Group.objects.filter(attributes__discord_role_id__in=role_ids)
avatar_url = None
if info.get("avatar"):
avatar_url = (
f"https://cdn.discordapp.com/avatars/{info['id']}/{info['avatar']}.png?size=128"
)
return {
"name": info.get("global_name") or info.get("username"),
"groups": list(groups.values_list("name", flat=True)),
"attributes": {
"discord": {
"id": info.get("id"),
"username": info.get("username"),
"guild_id": guild_id,
"is_member": is_member,
"role_ids": role_ids,
},
"avatar": avatar_url,
},
}- Click Finish.
- Edit the Discord OAuth source under Directory > Federation and Social login. Set Group matching mode to Link to a group with identical name.
- Under OAuth Attribute mapping > User Property Mappings, add the mapping to Selected User Property Mappings, and then click Update.
Only existing authentik groups with a matching discord_role_id are linked. Use distinct group names, because Link to a group with identical name can link a group created for another source. A Discord 404 result leaves the role list empty; other API errors stop the login rather than clearing membership.
To display the stored avatar, set the avatar configuration to attributes.avatar.
Check Discord guild membership
To deny login to users outside the guild, create an Expression Policy under Customization > Policies with this expression. It reads the result of the source property mapping above, so the policy does not call Discord again.
from authentik.sources.oauth.models import OAuthSource
source = request.context.get("source")
if not isinstance(source, OAuthSource) or source.provider_type != "discord":
return True
discord = request.context.get("prompt_data", {}).get("attributes", {}).get("discord", {})
if not discord.get("is_member"):
ak_message("You are not a member of the required Discord guild.")
return False
return TrueClick Finish, then bind the policy to both the Discord source's enrollment and authentication flows. See policy bindings and evaluation.
Check Discord guild role membership
To require a specific Discord role, create another Expression Policy with this expression. Set required_role_id to the role ID copied from Discord.
from authentik.sources.oauth.models import OAuthSource
required_role_id = "123456789123456789"
source = request.context.get("source")
if not isinstance(source, OAuthSource) or source.provider_type != "discord":
return True
discord = request.context.get("prompt_data", {}).get("attributes", {}).get("discord", {})
if required_role_id not in discord.get("role_ids", []):
ak_message("You do not have the required Discord role.")
return False
return TrueClick Finish, then bind the policy to both the Discord source's enrollment and authentication flows.
The mapping must be attached to the source before either policy is bound. If the mapping has not run, both policies deny Discord users because their mapped membership data is missing.
If a policy denies a returning user, the group update stage does not run. Any group membership from an earlier successful login remains until that user logs in successfully again or you remove it separately. Use the policy result, not the synchronized group, when you need to enforce current Discord membership at login.
Resources
Users Sources Sources Social Logins Entra Id Index (`website/docs/users-sources/sources/social-logins/entra-id/index.mdx`)
title: Log in with Entra ID
sidebar_label: Entra ID
tags:
- source
- entra
- azure
- scim
- oauth
There are several ways that Entra ID can be integrated with authentik to allow for user and group provisioning and authentication with Entra ID user credentials. If you are instead looking to authenticate to Entra ID with authentik credentials, refer to our Microsoft 365 SAML or Microsoft 365 WS-Federation integrations guides.
OAuth
The Entra ID OAuth guide explains how to set up Entra ID as a federated OAuth identity provider for authentik.
This enables users to sign in to authentik using their Entra ID credentials. User accounts are created in authentik upon first login and updated on each subsequent login.
Alternatively, Entra ID authentication can be embedded into a flow via a Source stage.
SCIM
The Entra ID SCIM guide explains how you can provision users and groups from Entra ID into authentik via the SCIM protocol.
Optionally, both the OAuth and SCIM integrations can be used in conjunction so that users and groups are provisioned before a user signs in using their Entra ID credentials. This is the recommended setup for organizations with large numbers of users and groups.
Users Sources Sources Social Logins Facebook Index (`website/docs/users-sources/sources/social-logins/facebook/index.mdx`)
title: Log in with Facebook
sidebar_label: Facebook
tags:
- source
- facebook
- meta
This source lets users authenticate with their Facebook credentials by configuring Facebook as a federated identity provider with OAuth 2.0.
Preparation
The following placeholders are used in this guide:
authentik.companyis the FQDN of the authentik installation.
Facebook configuration
To integrate Facebook with authentik, create an OAuth application in the Meta for Developers Dashboard.
- Log in to the Meta for Developers Dashboard with your Facebook account.
- After logging in, register as a developer. Refer to the Facebook development documentation for more information.
After registering, you need to create an application so that Facebook generates a unique ID for authentik.
- On the Meta for Developers Dashboard click Create.
- Follow the prompts to create the application.
After creating the application you need to customize its login settings.
- On the Meta for Developers Dashboard click Use Cases in the left navigation pane.
- Under Authentication and account creation click Customize and then Go to settings.
- Set the Valid OAuth redirect URIs field to
https://authentik.company/source/oauth/callback/facebook/and then click Save. - Navigate to the Use cases > Customize page.
- Under Permissions click Add for the email permission.
Next, you need to obtain the App ID and App Secret for the Facebook app. These will be required when creating the source in authentik.
- Go back to the Dashboard, and in the bottom-left of the navigation pane, click App settings > Basic.
- Take note of the App ID and the App secret values.
Finally, you need to publish the Facebook app.
- Go back to the Dashboard, and on the Create and publish this app page, follow the prompts to complete the process.
authentik configuration
To support the integration of Facebook with authentik, you need to create a Facebook OAuth source in authentik.
- Log in to authentik as an administrator and open the authentik Admin interface.
- Navigate to Directory > Federation and Social login, click New Source, and then configure the following settings:
- Select type: select Facebook OAuth Source as the source type.
- Create Facebook OAuth Source: provide a name, a slug that must match the slug used in the Facebook
Valid OAuth redirect URIsfield (e.g.facebook), and the following required configurations:- Protocol settings
- Consumer key: enter the App ID from Facebook.
- Consumer secret: enter the App Secret from Facebook.
- Scopes (optional): define any further access scopes.
- Protocol settings
- Click Finish to save your settings.
:::info Display new source on login screen
For instructions on how to display the new source on the authentik login page, refer to the Add sources to default login page documentation.
:::
:::info Embed new source in flow :ak-enterprise
For instructions on embedding the new source within a flow, such as an authorization flow, refer to the Source Stage documentation.
:::
Source property mappings
Source property mappings allow you to modify or gather extra information from sources. See the overview for more information.
Resources
Users Sources Sources Social Logins Github Index (`website/docs/users-sources/sources/social-logins/github/index.mdx`)
title: Log in with GitHub
sidebar_label: GitHub
tags:
- source
- github
This source lets users authenticate with their GitHub credentials by configuring GitHub as a federated identity provider with OAuth 2.0.
Preparation
The following placeholders are used in this guide:
authentik.companyis the FQDN of the authentik installation.www.my.companyis the Homepage URL for your site
GitHub configuration
To integrate GitHub with authentik, you need to create an OAuth application in GitHub Developer Settings.
Log in to GitHub and open the Developer Settings menu.
Create an OAuth app by clicking on the Register a new application button and set the following values:
- Application Name:
authentik - Homepage URL:
www.my.company - Authorization callback URL:
https://authentik.company/source/oauth/callback/github
- Application Name:
Click Register Application
Click Generate a new client secret and take note of the Client Secret and Client ID. These values will be required in the next section.
authentik configuration
To support the integration of GitHub with authentik, you need to create a GitHub OAuth source in authentik.
- Log in to authentik as an administrator and open the authentik Admin interface.
- Navigate to Directory > Federation and Social login, click New Source, and then configure the following settings:
- Select type: select GitHub OAuth Source as the source type.
- Create GitHub OAuth Source: provide a name, a slug that must match the slug used in the GitHub
Authorization callback URLfield (e.g.github), and set the following required configurations:- Protocol settings
- Consumer key:
<client_ID> - Consumer secret:
<client_secret> - Scopes (optional): define any further access scopes.
- Consumer key:
- Protocol settings
- Click Finish to save your settings.
:::info Display new source on login screen
For instructions on how to display the new source on the authentik login page, refer to the Add sources to default login page documentation.
:::
:::info Embed new source in flow :ak-enterprise
For instructions on embedding the new source within a flow, such as an authorization flow, refer to the Source Stage documentation.
:::
Optional additional configuration
Check for membership of a GitHub organization
GitHub's profile response does not contain organization membership. A source property mapping can use the OAuth client and token to query the membership API. The mapping below records whether the user is an active member and synchronizes a source-linked authentik group for active members.
- Edit the GitHub OAuth source under Directory > Federation and Social login. Add
read:orgunder Protocol settings > Scopes, and then click Update. - Navigate to Customization > Property Mappings. Click Create, select OAuth Source Property Mapping, and then click Next.
- Provide a name and enter this expression. Replace
your_organizationwith the GitHub organization login.
organization = "your_organization"
response = client.do_request(
"GET",
f"https://api.github.com/user/memberships/orgs/{organization}",
token=token,
)
if response.status_code == 404:
active = False
else:
response.raise_for_status()
active = response.json().get("state") == "active"
return {
"attributes": {"github_org_membership": {"organization": organization, "active": active}},
"groups": [f"github:{organization}"] if active else [],
}- Click Finish. Edit the GitHub OAuth source again and add the mapping under OAuth Attribute mapping > User Property Mappings > Selected User Property Mappings. Click Update.
authentik creates the github:<organization> group using the source's default group matching mode. It reconciles source-linked membership after successful logins. If the GitHub API returns an error other than 404, the mapping stops the login rather than treating an API failure as a membership denial.
To deny login to users outside the organization, create an Expression Policy with this expression and bind it to both the source's enrollment and authentication flows:
from authentik.sources.oauth.models import OAuthSource
source = request.context.get("source")
if not isinstance(source, OAuthSource) or source.provider_type != "github":
return True
membership = request.context.get("prompt_data", {}).get("attributes", {}).get(
"github_org_membership", {}
)
if not membership.get("active"):
ak_message("You are not an active member of the required GitHub organization.")
return False
return TrueThe policy reads the property mapping's result from the flow's prompt_data. Binding it to both flows covers new and returning users. For binding steps, see Bind a policy to a flow.
Flows use the ANY policy engine mode by default, so a flow passes when any one of its bound policies passes. The default source flows, default-source-enrollment and default-source-authentication, already bind a policy that passes on every source login, so in ANY mode the organization policy never denies a user. Edit each flow, and under Behavior settings, set Policy engine mode to ALL. See policy bindings and evaluation for details.
If the policy denies a returning user, the group update stage does not run. Any group membership from an earlier successful login remains until that user logs in successfully again or you remove it separately. Use the policy result, not the synchronized group, when you need to enforce current organization membership at login.
Source property mappings
The organization example above uses an OAuth source property mapping to query GitHub. See the source property mappings overview and OAuth expression data for other fields and client methods.
Resources
Users Sources Sources Social Logins Gitlab Index (`website/docs/users-sources/sources/social-logins/gitlab/index.mdx`)
title: Log in with GitLab
sidebar_label: GitLab
tags:
- source
- gitlab
This source lets users authenticate with their GitLab credentials by configuring GitLab as a federated identity provider with OAuth 2.0.
Preparation
The following placeholders are used in this guide:
authentik.companyis the FQDN of the authentik installation.gitlab.companyis the FQDN of the GitLab installation. Usegitlab.comfor GitLab SaaS.
GitLab configuration
To integrate GitLab with authentik, you need to create an OAuth application in GitLab.
Log in to GitLab and navigate to the application settings:
- For a user-owned application, select your avatar, click Edit profile, and then navigate to Access > Applications.
- For a group-owned application, navigate to the group and then click Settings > Applications.
- For an instance-wide application, navigate to Admin > Applications.
Click Add new application or New application and set the following values:
- Name:
authentik - Redirect URI:
https://authentik.company/source/oauth/callback/gitlab/ - Scopes: select all four of the following:
read_useropenidprofileemail
- Name:
Click Save application and take note of the Application ID and Secret. These values are required in the next section.
authentik configuration
To support the integration of GitLab with authentik, you need to create a GitLab OAuth source in authentik.
- Log in to authentik as an administrator and open the authentik Admin interface.
- Navigate to Directory > Federation and Social login, click New Source, and then configure the following settings:
- Select type: select GitLab OAuth Source as the source type.
- Create GitLab OAuth Source: provide a name, a slug that must match the slug used in the GitLab Redirect URI field (e.g.
gitlab), and set the following required configurations:- Under Protocol settings:
- Consumer key: set the Application ID from GitLab.
- Consumer secret: set the Secret from GitLab.
- Under URL settings (self-hosted GitLab instances only):
- Authorization URL:
https://gitlab.company/oauth/authorize - Access token URL:
https://gitlab.company/oauth/token - Profile URL:
https://gitlab.company/oauth/userinfo - OIDC Well-known URL:
https://gitlab.company/.well-known/openid-configuration - OIDC JWKS URL:
https://gitlab.company/oauth/discovery/keys
- Authorization URL:
- Under Protocol settings:
- Click Finish to save your settings.
:::info Display new source on login screen
For instructions on how to display the new source on the authentik login page, refer to the Add sources to default login page documentation.
:::
:::info Embed new source in flow :ak-enterprise
For instructions on embedding the new source within a flow, such as an authorization flow, refer to the Source Stage documentation.
:::
Source property mappings
Source property mappings allow you to modify or gather extra information from sources. See the overview for more information.
Resources
--- METRICS ---
- Files Extracted: 101
- Estimated Token Budget: ~124835 tokens
- Canonical Reference: https://codewiki.google/github.com/goauthentik/authentik