2021-08-15 18:58:52 +00:00
---
title: Portainer
---
2022-06-15 19:31:34 +00:00
< span class = "badge badge--secondary" > Support level: Community< / span >
2021-08-15 18:58:52 +00:00
## What is Portainer
From https://www.portainer.io/
:::note
Portainer is a powerful, GUI-based Container-as-a-Service solution that helps organizations manage and deploy cloud-native applications easily and securely.
:::
:::note
2022-05-09 19:22:41 +00:00
This is based on authentik 2021.7.3 and Portainer 2.6.x-CE. Portainer 2.6 supports OAuth without additional licenses, 1.x Series requires a paid license for OAuth.
2021-08-15 18:58:52 +00:00
:::
## Preparation
The following placeholders will be used:
2022-09-01 10:49:09 +00:00
- `portainer.company` is the FQDN of Portainer.
2022-05-09 19:22:41 +00:00
- `authentik.company` is the FQDN of authentik.
2021-08-15 18:58:52 +00:00
2021-10-18 14:35:12 +00:00
### Step 1 - authentik
2021-08-15 18:58:52 +00:00
In authentik, under _Providers_ , create an _OAuth2/OpenID Provider_ with these settings:
:::note
Only settings that have been modified from default have been listed.
:::
**Protocol Settings**
2022-05-09 19:22:41 +00:00
- Name: Portainer
- Client ID: Copy and Save this for Later
- Client Secret: Copy and Save this for later
2022-09-01 10:49:09 +00:00
- Redirect URIs/Origins: `https://portainer.company/`
2021-08-15 18:58:52 +00:00
### Step 2 - Portainer
In Portainer, under _Settings_ , _Authentication_ , Select _OAuth_ and _Custom_
2022-05-09 19:22:41 +00:00
- Client ID: Client ID from step 1
- Client Secret: Client Secret from step 1
- Authorization URL: `https://authentik.company/application/o/authorize/`
- Access Token URL: `https://authentik.company/application/o/token/`
2022-09-01 10:49:09 +00:00
- Redirect URL: `https://portainer.company`
2022-05-09 19:22:41 +00:00
- Resource URL: `https://authentik.company/application/o/userinfo/`
- Logout URL: `https://authentik.company/application/o/portainer/end-session/`
2023-02-03 13:37:31 +00:00
- User Identifier: `preferred_username` (Or `email` if you want to use email addresses as identifiers)
2022-05-09 19:22:41 +00:00
- Scopes: `email openid profile`
2021-08-15 18:58:52 +00:00
:::note
2022-05-09 19:22:41 +00:00
Portainer by default shows commas between each item in the Scopes field. Do **NOT** use commas. Use a _space_
2021-08-15 18:58:52 +00:00
:::
2021-08-15 19:39:24 +00:00
![](./port1.png)
2021-08-15 18:58:52 +00:00
2021-10-18 14:35:12 +00:00
### Step 3 - authentik
2021-08-15 18:58:52 +00:00
In authentik, create an application which uses this provider. Optionally apply access restrictions to the application using policy bindings.
2022-05-09 19:22:41 +00:00
- Name: Portainer
- Slug: portainer
- Provider: Portainer
2022-09-01 10:49:09 +00:00
- Launch URL: https://portainer.company
2021-08-15 18:58:52 +00:00
## Notes
:::note
Portainer Reference link: https://documentation.portainer.io/v2.0/auth/oauth/
:::