website/integrations/hypervisors-orchestrators/portainer/index.md
Portainer is a powerful, GUI-based Container-as-a-Service solution that helps organizations manage and deploy cloud-native applications easily and securely.
:::info This documentation has been tested with authentik 2025.10.3 and Portainer 2.33.6 LTS. :::
The following placeholders are used in this guide:
portainer.company is the FQDN of the Portainer installation.authentik.company is the FQDN of the authentik installation.:::info This documentation lists only the settings that you need to change from their default values. Be aware that any changes other than those explicitly mentioned in this guide could cause issues accessing your application. :::
To support the integration of Portainer with authentik, you need to create an application/provider pair in authentik.
Strict redirect URI to https://portainer.company/.Client ID from the authentik providerClient secret from the authentik providerhttps://authentik.company/application/o/authorize/https://authentik.company/application/o/token/https://authentik.company/application/o/userinfo/https://portainer.company/https://authentik.company/application/o/portainer/end-session/preferred_username (or email if you would prefer to use email addresses as identifiers)email openid profile.:::caution By default, Portainer shows commas between each item in the Scopes field. Do NOT use commas. Use a space. :::
If you are using Portainer Business Edition (BE), it is possible to configure automatic team membership. This allows you to grant access to teams and environments, and automatically grant admin access to certain users based on authentik group membership. It is only possible to configure automatic group membership in Portainer BE - this cannot be configured in the Community Edition.
For this section, we will presume that you already have two teams configured in Portainer: engineering and sysadmins. Please reference Portainer's documentation for information on managing teams and access to environments based on team membership.
We will also presume that two groups have been created in authentik: Portainer Admins and Portainer Users. See Manage groups. You can choose any group names - replace Portainer Admins and Portainer Users later in this guide with your chosen names.
Log in to authentik as an administrator and open the authentik Admin interface.
Navigate to Customization > Property Mappings and click Create.
Select type: select Scope Mapping.
Configure the Scope Mapping: Provide a descriptive name (e.g. authentik portainer OpenID Mapping: OAuth 'groups'), and an optional description.
groupsgroups = []
if request.user.groups.filter(name="Portainer Admins").exists():
groups.append("admin")
if request.user.groups.filter(name="Portainer Users").exists():
groups.append("user")
return {
"groups": groups
}
In the expression above, we filter on the group names Portainer Admins and Portainer Users. You can use any groups that exist in authentik - just ensure that the group names entered here exactly match those setup in authentik (they are case-sensitive).
Click Finish.
Navigate to Applications > Providers.
Select your provider for Portainer, and click Edit.
Under Advanced protocol settings, add the property mapping created in the previous step to selected scopes.
Click Update to save your changes to the provider.
Navigate to Directory > Groups.
Add users to each of the groups that you have defined in your expression, as desired.
:::info Application binding Since we are configuring access to Portainer based on group membership, it is recommended that you configure a binding (policy, group, or user) for the application in authentik such that access is restricted to these groups. :::
groups^user$ maps to team engineering.^admin$ maps to team sysadmins.engineering^admin$.groups to Scopes. The full value for Scopes should then be email openid profile groups.To verify the integration of authentik with Portainer, log out of Portainer, then on the login page click Login with OAuth. You should be redirected to authentik and, after successful authentication, automatically logged in to Portainer.