Automated authentik Agent deployment
authentik: 2025.12.0+
The authentik Agent can be deployed at scale to multiple devices via Mobile Device Management (MDM) and automation tools.
To enforce authentik Agent settings on devices, refer to Agent settings and policies.
Prerequisites
You must configure your authentik deployment to support the authentik Agent.
Create an enrollment token
If you have already created an enrollment token, skip to the next section.
- Log in to authentik as an administrator and open the authentik Admin interface.
- Navigate to Endpoint Devices > Connectors.
- Click on the authentik Agent connector that you created when configuring your authentik deployment to support the authentik Agent.
- Under Enrollment Tokens, click New Enrollment Token, and configure the following settings:
- Token name: provide a descriptive name for the token
- Device group (optional): select a device access group for the device to be added to after completing enrollment
- Expiring (optional): set whether the enrollment token expires.
- Click Create.
How automated enrollment works
Each of the following sections deploys an enrollment configuration to a device. The configuration contains the URL of your authentik deployment and an enrollment token. The authentik system service (ak-sysd) reads the configuration when it starts and joins the device to an authentik domain named ak-mdm-managed.
With authentik Agent 0.73.1 and later:
- If the device was also joined to a domain manually, the domain from the enrollment configuration takes priority.
- If the enrollment configuration is removed from the device, the system service removes the
ak-mdm-manageddomain the next time it starts. - You can list the domains that a device has joined, and which one is active, with the
ak-sysd domains listcommand. Run the command with administrative privileges and use the path ofak-sysdfor your platform. For example, on Linux:
sudo ak-sysd domains list
Linux
Automated enrollment on Linux requires authentik Agent 0.70 or later.
- Create the file
/etc/authentik/managed.jsonwith the following content:
{
"url": "https://authentik.company",
"registration_token": "<enrollment_token>"
}
- Ensure that the file is owned by
rootand that onlyrootcan read it. The system service ignores the file if the group or others have any permissions on it.
sudo chown root:root /etc/authentik/managed.json
sudo chmod 0400 /etc/authentik/managed.json
- Install the authentik Agent packages. If the packages are already installed, restart the system service:
sudo systemctl restart ak-sysd
Windows
- Log in to authentik as an administrator and open the authentik Admin interface.
- Navigate to Endpoint Devices > Connectors.
- Click on the authentik Agent connector that you created when configuring your authentik deployment to support the authentik Agent.
- Under Setup, select the enrollment token that you wish to use for enrolling devices.
- Click Windows and then click either Download or Copy to obtain your SyncML MDM configuration snippet.
This SyncML snippet can be used by Microsoft Intune, Microsoft Endpoint Manager, and other MDM tools to deploy the changes required to support the authentik Agent.
The following two registry keys (REG_SZ) are added by the configuration snippet:
HKLM/SOFTWARE/authentik Security Inc./Platform/ManagedConfig/RegistrationTokenHKLM/SOFTWARE/authentik Security Inc./Platform/ManagedConfig/URL
macOS
- Log in to authentik as an administrator and open the authentik Admin interface.
- Navigate to Endpoint Devices > Connectors.
- Click on the authentik Agent connector that you created when configuring your authentik deployment to support the authentik Agent.
- Under Setup, select the enrollment token that you wish to use for enrolling devices.
- Click macOS and then click either Download or Copy to obtain your MDM policy.
This policy can be used by Apple Business Manager, Fleet, and other MDM tools to deploy the changes required to support the authentik Agent. It also configures Platform SSO, which allows users to log in to and unlock their Mac with authentik credentials.
Apple requires an MDM tool to apply this policy to a device. The policy does not work when applied manually.
User registration
After the authentik Agent is deployed to a device, the user receives a notification asking them to register with authentik. The registration flow prompts the user to authenticate with authentik. After authentication, authentik enrolls the device and associates it with the user.
Each time the policy is downloaded, it contains new payload identifiers. Installing a newly downloaded policy on a device that is already registered prompts its users to register again. Refer to macOS local device login for more information.