Docker container for use as Identity Provider and authentication portal in front of a Traefik reverse-proxy.
- 1. Docker Setup
- 2. Authentik Setup
- 3. Authentik configuration
- 4. Applications setup
- 5. 2.8 Jellyseerr
- Initialize config by running init.sh:
./init.sh - Input personal information into
.env - Generate postgresql password and authentik secret key, by using e.g.
openssl rand 56 | base64, and input into.env - Make sure that Docker network
traefikexists,docker network ls - Run
docker compose upand check logs
- Find the TOTP table name:
docker exec authentik-db psql -U authentik -c "\dt *totp*"(probably namedauthentik_stages_authenticator_totp_totpdevice) - Delete TOTP device for USER:
docker exec authentik-db psql -U authentik -c "DELETE FROM authentik_stages_authenticator_totp_totpdevice WHERE user_id = (SELECT id FROM authentik_core_user WHERE username = '<USER>');" - Log in with the USER account and you should be promted to connect a new MFA device
Updated for version 2025.6.3
- Open browser and go to
auth.YOURDOMAIN.COMand verify that you reach the Authentik login screen - Add
/if/flow/initial-setup/at the end of the URL to reach the dialogue for setting up the initial admin account - Input the email and password you want to use for the default
akadminaccount and pressContinue - Log into the default admin account using either usename
akadminor the email you entered in the previous step - Click the
Admin interfacebutton on the top-right - Go to
Directory->Usersin the menu on the left side and clickCreate - Input
UsernameandName, selectUser type: Internal, inputEmail, finally click Create - Click on your recently created user and go to the
Groupstab and clickAdd to existing group - Click on the plus sign, select
authentik Adminsand pressAdd, then pressAddagain - Go back to the
Overviewtab and clickSet passwordunder theRecoverysection - Log out of the current session and log in with your new user account instead
- Go back to
Directory->Usersand click on theakadminuser - In the
User Infopane scroll down to theActionssection and press theDeactivatebutton, then pressUpdatein the popup prompt
You have now logged in for the first time, created your own user account and disabled the default admin account.
- In the
Admin interface, go toApplications->Outposts, locate theauthentik Embedded Outpostand verify that is saysLoggin in via https://auth.YOURDOMAIN.COMin green below the name - Go to
Applications->Providersand clickCreate - Select
Proxy Providerand clickNext - Input a
Name, e.g.Traefik Providerand selectAuthorization flowwith either implicit or explicit consent (determines if you are presented with an explicit prompt when being forwarded after logging in or not, prefer implicit) - Click
Forward auth (domain level), check thatAuthentication URLishttps://auth.YOURDOMAIN.COMand setCookie domainsimply asYOURDOMAIN.COM - Change
Token validityto your taste and clickFinish - Go to
Applications->Applicationsand clickCreate - Input
NameandSlug, e.g.Traefik//traefik - Click the
Providerfield and selectTraefik Provider(or whatever you named it in the previous step) and finally clickCreate - Go back to
Applications->Providersand verify thatTraefik Providerhas a green checkmark and the textAssigned to application Traefikunder theApplicationcolumn - Go back to
Applications->Outpostsand click theEditbutton for theauthentik Embedded Outpost(under theActionscolumn) - In the
Applicationssection click onTraefikand press the > button to add it toSelected Applications, then pressUpdate
You have now set up Authentik to be ready to be used with Traefik reverse-proxy with domain level forward auth.
- Go to your Traefik dir and open
dynamic_config.yml - Add an Authentik middleware:
middlewares: authentik-auth: forwardAuth: # Match base url to authentik server container name address: http://authentik-server:9000/outpost.goauthentik.io/auth/traefik trustForwardHeader: true authResponseHeaders: - X-authentik-username - X-authentik-groups - X-authentik-email - X-authentik-name - X-authentik-uid - X-authentik-jwt - X-authentik-meta-jwks - X-authentik-meta-outpost - X-authentik-meta-provider - X-authentik-meta-app - X-authentik-meta-version - Optionally create a middleware chain that includes default security headers:
middlewares: authentik: chain: middlewares: - authentik-auth - default-security-headers
Now you can use Authentik together with Traefik by including the authentik middleware in container labels, e.g.: traefik.http.routers.APP_NAME.middlewares=authentik@file.
To verify that the email settings in .env are correct run docker compose exec worker ak test_email RECIPIENT_EMAIL to send a test email to RECIPIENT_EMAIL.
Certain password managers will have an easier time auto-typing your login info if the username and password fields are both presented at once.
- Go to
Flows and Stages->Stagesand clickEditfor thedefault-authentication-identificationstage - Under
Password stageselectdefault-authentication-password - (Optional) Enable
Enable "Remember me on this device" - Click
Update - Go to
Flows and Stages->Flowsand click thedefault-authentication-flowstage - Go to the
Stage Bindingstab and delete thedefault-authentication-passwordstage
It's a good idea to enforce some kind of password policy.
- Go to
Customisation->Policiesand clickCreate - Select
Password Policyand clickNext - Set a suitable
Name, e.g.password-complexity - Expand the
Static rulessection - Input your choice of rules and enter an
Error messagethat reflects the requirements, e.g.Please enter a minimum of 12 characters with at least 1 uppercase, 1 lowercase, 1 digit and 1 symbol character. - Click
Finish - Go to
Flows and Stages->Stages, clickEditfor thedefault-source-enrollment-promptstage - Scroll down to
Validation Policies, select the password policy created previously underAvailable Policiesand click>to add it to `Selected Policies. - Make sure to remove any other default policies and click
Update - Repeat above for the
default-password-change-promptstage while also removing thedefault-password-change-password-policyif present
It's a good idea to enforce MFA for something that provides such powerful means of access. Here's how to force setup of MFA using TOTP using e.g. Google Authenticator app.
- Go to
Flows and Stages->Stages, clickEditfordefault-authentication-mfa-validation - Under
Stage-specific settings->Device classesselect the MFA types you want to allow, in this case onlyTOTP Authenticatorsfor Google Authenticator app - Set
Not configured actiontoForce the user to configure an authenticator - Under
Configuration stagesselect onlydefault-authenticator-totp-setup, clickUpdate - Go to
Flows and Stages->Flowsand click ondefault-source-enrollment - Go to the
Stage Bindingstab, clickBind existing stageand input:- Stage:
default-authentication-mfa-validation - Order: 2
- Stage:
- Update the order of the
default-source-enrollment-loginstage to 3, the resulting list should be:Order Name 0 default-source-enrollment-prompt 1 default-source-enrollment-write 2 default-authentication-mfa-validation 3 default-source-enrollment-login
If users forget their password it's nice if they're able to reset their passwords on their own.
- Go to
Flows and Stages->Stagesand clickCreate - Select
Identification Stageand clickNext - Set a suitable name, e.g.
recovery-authentication-identification, underUser fieldsselectUsernameandEmailand clickFinish - Click
Createagain and selectEmail Stage, clickNext - Set a suitable
Name, e.g.recovery-email - Set
Subjectto e.g.Authentik password recovery, clickFinish - Go to
Flows and Stages->Flowsand clickCreate - Set
Name/Title/SlugasRecovery/Recovery/recovery - Set
DesignationasRecovery - Click
Create - Click on the
recoveryflow we just created and go to theStage Bindingstab - Add bindings by clicking
Bind existing stageand setting up according to the table below:Order Stage Type 10 recovery-authentication-identification Identification Stage 20 recovery-email Email Stage 30 default-password-change-prompt Prompt Stage 40 default-password-change-write User Write Stage - Go to
Flows and Stages->Stagesand clickEditfor thedefault-authentication-identificationstage - Under
Flow settings->Recovery flowselectrecovery (Recovery)and clickUpdate
To be able to manually generate a recovery link for a user also:
- Go to
System->Brandsand clickEditfor the relevant brand (probablyauthentik-default) - Expand the
Default flowssection and setRecovery flowtorecovery (Recovery) - Click
Update
It's a bad idea to allow anyone visiting the login page to register for an account. Invitation link with a set expiration time is a better solution.
-
Go to
Directory->Groupsand clickCreate -
Set a suitable name, e.g.
authentik Users -
Make sure
Is superuseris switched OFF, clickCreate -
Click on your recently created group, go to the
Userstab and click onAdd existing user -
Click on the plus sign, select your currently existing normal user accounts, press
Addand then pressAddagain -
Go to
Flows and Stages->Stagesand clickCreate -
Select
User Write Stageand clickNext -
Set a suitable name, e.g.
enrollment-invitation-write -
Under
Stage-specific settingsmake sureCreate users when requiredis selected and uncheckCreate users as inactive -
Under
User typemake sureInternalis selected -
Under
Groupselect the recently createdauthentik Usersgroup -
Click
Finish -
Click
Createagain and selectInvitation Stage, clickNext -
Set a suitable name, e.g.
enrollment-invitation -
Make sure
Continue flow without invitationis OFF and clickFinish -
Click
Createagain and selectEmail Stage -
Set
Nametoenrollment-invitation-email,SubjecttoAccount ConfirmationandTemplatetoAccount Confirmation, finally clickFinish -
Go to
Flows and Stages->Flowsand clickCreate -
Set
NameandTitletoEnrollment Invitation -
Set
DesignationtoEnrollment -
Under
Behavior settingscheckCompatibility modeand clickCreate -
Click the recently created
enrollment-invitationflow and go to theStage Bindingstab -
Add bindings by clicking
Bind existing stageand setting up according to the table below:Order Stage Type 10 enrollment-invitation Invitation Stage 20 default-source-enrollment-prompt Prompt Stage 30 enrollment-invitation-write User Write Stage 40 enrollment-invitation-email Email Stage 50 default-source-enrollment-login User Login Stage -
Click on
Edit Stagefor thedefault-source-enrollment-promptstage -
Under
Stage-specific settings->Fieldsselect the following entries:- default-user-settings-field-username
- default-user-settings-field-name
- default-user-settings-field-email
- initial-setup-field-password
- initial-setup-field-password-repeat
-
Check under
Validation Policiesthatpassword-complexityis selected, clickUpdate
You can now go to Directory->Invitations and click Create to create an invitation link. Set a suitable name and expiration time. Make sure to select the enrollment-invitation flow and make sure Single use is checked.
- Expand the recently created invite and
Link to use the invitationwill contain the link to be distributed.
-
Go to
Directory->Groupsand create the following groups:- forgejo Restricted
- forgejo User
- forgejo Admin
-
Add your user to the relevant group
-
Go to
Customization->Property Mappingsand clickCreate -
Select
Scope Mappingand clickNext -
Enter the following:
- Name:
Forgejo Profile - Scope name:
forgejo - Expression:
entitlement_names = { entitlement.name for entitlement in request.user.app_entitlements(provider.application) } forgejo_claims = {} if "gitrestricted" in entitlement_names: forgejo_claims["forgejo"] = "restricted" if "gituser" in entitlement_names: forgejo_claims["forgejo"] = "user" if "gitadmin" in entitlement_names: forgejo_claims["forgejo"] = "admin" return forgejo_claims - Name:
-
Click
Finish -
Go to
Applications->Applicationsand clickCreate with Provider -
Enter the following:
- Application Name:
Forgejo - Slug:
forgejo
- Application Name:
-
Click
Next -
Select
Oauth2/OpenID Providerand clickNext -
Enter the following:
- Provider Name:
Forgejo Provider - Authorization flow:
implicit-consent - Redirect URIs/Origins: Strict -
https://git.DOMAIN.COM/user/oauth2/authentik/callback - Advanced protocol settings->Scopes: Add
authentik default OAuth Mapping: Application EntitlementsandForgejo Profile - Advanced protocol settings->Subject mode:
Based on User's username
- Provider Name:
-
Click
Nexttwice -
Click
Submit -
Click on the created Application, go to the
Application entitlementstab and create these entitlements:- gitrestricted
- gituser
- gitadmin
-
Bind the entitlements to the previously created groups
- Click on the profile button at the top-right and select
Site administration - Go to
Identity & access->Authentication sourcesand clickAdd authentication source - Enter the following:
- Authentication type:
OAuth2 - Authentication name:
authentik - OAuth2 provider:
OpenID Connect - Client ID (Key): Copy from Forgejo Provider in Authentik
- CLient Secret: Copy from Forgejo Provider in Authentik
- Icon URL: https://auth.DOMAIN.COM/static/dist/assets/icons/icon.png
- OpenID Connect Auto Discovery URL:
https://auth.DOMAIN.COM/application/o/forgejo/.well-known/openid-configuration - Additional scopes:
email profile forgejo - Required claim name:
forgejo - Claim name providing group names for this source:
forgejo - Group claim value for administrator users:
admin - Group claim value for restricted users:
restricted
- Go to
Directory->Groupsand create the following groups:- gramps-0-guest
- gramps-1-member
- gramps-2-contributor
- gramps-3-editor
- gramps-4-owner
- gramps-5-admin
- Go to
Customization->Property Mappingsand clickCreate - Select
Scope Mappingand clickNext - Enter the following:
- Name:
Gramps Groups - Scope name:
groups - Description:
https://www.grampsweb.org/install_setup/users/#user-roles - Expression:
- Name:
return {
"groups": [g.name for g in request.user.ak_groups.all()]
}
- Click
Finish - Open the
authentik default OAuth Mapping: OpenID 'email'scope mapping and make sure theExpressionfield containsemail_verified: True
- Go to
Applications->Providersand clickCreate - Select
OAuth2/OpenID Providerand clickNext - Enter the following:
- Name:
Gramps Provider - Authorization flow:
implicit-consent - Client type:
Confidential - Redirect URIs/Origins (RegEx): RegEx,
https://gramps.b3rl1n.com/api/oidc/callback/.*
- Name:
- Take note of the
Client IDandClient Secret, we will need these in the application setup - Expand the
Advanced protocol settingssection and make sure the following scopes are listed underSelected Scopes:- authentik default OAuth Mapping: OpenID 'email'
- authentik default OAuth Mapping: OpenID 'openid'
- authentik default OAuth Mapping: OpenID 'profile'
- Gramps Groups
- Set
Subject modetoBased on the User's username - Click
Finish
- Go to
Applications->Applicationsand clickCreate - Enter the following:
- Name:
Gramps - Slug:
gramps - Provider:
Gramps Provider
- Name:
- Click
Create
Input the Client ID and Client Secret values (and possibly adjust the value of the OIDC_GROUP_* parameters if you named your Authentik groups differently) and you are good to go.
- Go to
Applications->Providersand clickCreate - Select
OAuth2/OpenID Providerand clickNext - Enter the following:
- Name:
HomeAssistant Provider - Authorization flow::
implicit-consent - Client type:
Confidential - Redirect URIs/Origins (RegEx): Strict,
https://hass.DOMAIN.COM/auth/openid/callback
- Name:
- Take note of the
Client IDandClient Secret, we will need transfer these into HomeAssistant config - Click
Finish - Go to
Applications->Applicationsand clickCreate - Enter the following:
- Name:
HomeAssistant - Slug:
home-assistant - Provider:
HomeAssistant Provider
- Name:
- Click
Create
- Log into HomeAssistant as the admin user via local ip
- Install the
Terminal & SSHaddon by going toSettings->Add-ons, clicking on theAdd-on storebutton at the bottom right, searching forTerminal & SSHand clickingInstall - Click
Terminalin the left-side menu and runwget -O - https://get.hacs.xyz | bash -to installHome Assistant Community Store (HACS) - Go to
Settings->Devices & services, clickAdd integrationat the bottom right, search forHACS, acknowledge the statements and clickSUBMIT - Link HACS to your GitHub account (read-only access)
- Open
HACSin the left-side menu and search for the addonSimple OpenID Connect (OIDC / SSO)by usercavefire, install it - Open
/homeassistant/configuration.yaml, e.g. by using theTerminal & SSHaddon - Enter the following config at the bottom of the file:
homeassistant:
external_url: https://hass.DOMAIN.COM
internal_url: http://LOCAL_HASS_SERVER_IP:8123
http:
use_x_forwarded_for: true
trusted_proxies:
- LOCAL_TRAEFIK_SERVER_IP
openid:
client_id: FROM_AUTHENTIK
client_secret: FROM_AUTHENTIK
configure_url: "https://auth.DOMAIN.COM/application/o/home-assistant/.well-known/openid-configuration"
username_filed: "preferred_username"
scope: "openid profile email"
block_login: true
trusted_ips: #List of CIDR blocks that are not affected by block_login
- "10.0.0.0/24" # e.g.
openid_text: "Login with Authentik" # Text to display on the login page
create_user: true # Automatically create users on first login
Authentik has a community integration for Immich to allow user login and provisioning via Authentik.
- Open the Authentik Admin Interface
- Go to
Applications->Providersand clickCreate - Select
OAuth2/OpenID Providerand clickNext - Enter the following:
- Name:
Immich Provider - Authorization flow:
implicit-consent - Client type:
Confidential - Redirect URIs/Origins (RegEx):
https://immich.DOMAIN.COM/auth/loginhttps://immich.DOMAIN.COM/user-settingsapp.immich://oauth-callback
- Name:
- Take note of the
Client IDandClient Secret, we will need these in the Immich setup - Click
Finish - Go to
Applications->Applicationsand clickCreate - Enter the following:
- Name:
Immich - Slug:
immich - Provider:
Immich Provider
- Name:
- Click
Create
- Log in with the admin account initially set up for Immich
- Click the top-right circle icon and select
Administration - From the left-side menu select
Settingsand thenAuthentication Settings->OAuth - Enable
Login with OAuthand fill out:- ISSUER_URL:
https://auth.DOMAIN.COM/application/o/immich/ - CLIENT_ID: Use value from Authentik Provider setup
- CLIENT_SECRET: Use value from Authentik Provider setup
- AUTO LAUNCH: Set to ON
- ISSUER_URL:
- Click
Saveat the bottom of the form
Authentik doesn't have an outright integration for Inventree but Inventree supports general OIDC.
- Go to
Customization->Propery Mappingsand clickCreate - Select
Scope Mappingand clickNext - Enter the following:
- Name:
Inventree Profile Mapping - Scope name:
profile - Description:
Split Authentik displayname into separate First and Last Name entities for conformity with how Inventree handles user names - Expression:
name_parts = request.user.name.split(" ", 1) given = name_parts[0] family = name_parts[1] if len(name_parts) > 1 else "" return { "name": request.user.name, "given_name": given, "family_name": family, "preferred_username": request.user.username, "nickname": request.user.username, "groups": [group.name for group in request.user.groups.all()], } - Name:
- Click
Finish - Go to
Applications->Providersand clickCreate - Select
OAuth2/OpenID Providerand clickNext - Enter the following:
- Name:
Inventree Provider - Authorization flow::
implicit-consent - Client type:
Confidential - Redirect URIs/Origins (RegEx): ("authentik" refers to the provider id set in Inventree)
https://parts.DOMAIN.COM/accounts/authentik/login/callback/https://inventree.DOMAIN.COM/accounts/authentik/login/callback/
- Name:
- Take note of the
Client IDandClient Secret, we will need these in the Inventree setup - Expand the
Advanced protocol settingssection and look at theSelected Scopeslist - Remove
authentik default OAuth Mapping: OpenID 'profile'and addInventree Profile Mapping - Set
Subject modetoBased on the User's username - Click
Finish - Go to
Applications->Applicationsand clickCreate - Enter the following:
- Name:
Inventree - Slug:
inventree - Provider:
Inventree Provider
- Name:
- Click
Create
- Log in as superuser/admin and go to
Admin Center - Under
Operations->Users / Access, expand theGroupssection and add groups calledAdminsandUsers - Go to
System Settings->Authentication - Make sure that the following options are ON:
- Enable SSO
- Enable SSO registration
- Auto-fill SSO users
- Enable SSO group sync
- Remove groups outside of SSO
- Make sure that the following option is OFF:
- Enable registration
- Set
SSO group mapto{"inventree Admins": "Admins"} - Set
Group on signuptoUsers - Go to the Django admin panel by entering
https://inventree.DOMAIN.COM/admin/, scroll down toSOCIAL ACCOUNTSand click onSocial applications - Click
ADD SOCIAL APPLICATION +and enter:- Provider:
OpenID Connect - Provider ID:
authentik - Name:
Authentik - Client id: As per the Authentik Provider
- Secret key: As per the Authentik Provider
- Settings:
{"server_url": "https://auth.DOMAIN.COM/application/o/inventree/"}
- Provider:
- Click
SAVE
Note that you will need to promote users to staff/superuser status manually as at the time of writing there's no natively supported way to automate it.
We're not using Authentik middleware here but instead relying on LDAP for automating user setup and logging in via the regular Jellyfin login
First we need to setup a flow for allowing the service account access
- Create a LDAP service password stage by going to
Flows and Stages->Stages->Createand entering:
- Select type:
Password Stage - Name:
ldap-service-password - Backends:
User database + standard password(only)
-
Click
Finish -
Create an Identificaton Stage by going to
Flows and Stages->Stages->Createand entering:
- Select type:
Identification Stage - Name:
ldap-service-identification - User fields:
Username - Password stage:
ldap-service-password
-
Click
Finish -
Create a User Login stage by goign to
Flows and Stages->Stages->Createand entering:
- Select type:
User Login Stage - Name:
ldap-service-login
-
Click
Finish -
Create an authentication flow specifically for LDAP service accounts by going to
Flows and Stages->Flows->Createand entering:
- Name:
LDAP Service Account Bind - Title:
LDAP Service Account Bind - Slug:
ldap-service-account-bind - Designation:
Authentication - Authentication:
No requirement
- Click
Create - Open the created flow and go to the
Stage Bindingstab - Click
Bind existing Stageand enter:
- Stage:
ldap-service-identification - Order: 10
- Click
Create - Click
Bind existing Stageagain and enter:
- Stage:
ldap-service-login - Order: 30
-
Click
Create -
Create a LDAP service account for the LDAP plugin in Jellyfin to use to lookup users (read-only) by going to
Directory->Users->Create Service accountand entering:
- Username:
jellyfin-ldap - Create group:
Disable - Expiring:
Disable
-
Click
Createand take note of the generatedPassword, clickClose -
Create a role for LDAP search by going to
Directory->Roles->Create, naming itLDAP Searchand clickingCreate -
Go to
Applications->Providersand click on theJellyfin LDAPprovider (not edit) -
Go to the
Permissionstab, clickAssign Object Permissionand enter:
- Role:
LDAP Search - Search full LDAP directory: Enabled
-
Click
Assign -
Go to
Directory->Users->jellyfin-ldap->Roles -
Click
Add to existing role, select theLDAP Searchrole and clickAdd, thenAddagain -
Create an LDAP provider by going to
Applications->Providers->Create->LDAP Providerand entering:
- Name:
Jellyfin LDAP - Bind mode:
Direct binding - Search mode:
Direct querying - Code-based MFA Support:
Disabled - Bind flow:
ldap-service-account-bind(has to be flow without MFA enforced!) - Unbind flow:
default-invalidation-flow - Base DN: Leave as default (`DC=ldap,DC=goauthentik,DC=io)
-
Click
Finish -
Create a matching Application by going to
Applications->Applications->Createand entering:
- Name:
Jellyfin - Slug:
jellyfin - Provider:
Jellyfin LDAP
-
Click
Create -
Create an LDAP outpost by going to
Applications->Outposts->Createand entering:
- Name:
Jellyfin LDAP Outpost - Type:
LDAP
- Move the
Jellyfinapplication toSelected Applications - Click
Create - Click the
View Deployment Infoon the newly create outpost and then onClick to copy tokenunderAUTHENTIK_TOKEN - Click
Close - Open your
.envfile and setAUTHENTIK_LDAP_TOKENto the value you just copied from the outpost - Restart the LDAP container:
docker compose up -d --force-restart ldap
- Install the LDAP plugin by logging in as an admin account and going to
Dashboard->Catalogand locatingLDAP Authenticationand clickingInstall - Restart jellyfin:
docker compose up -d --force-recreate jellyfin - Configure the plugin with the following:
- LDAP Server:
authentik-ldap - LDAP Port:
389 - Bind User:
cn=ldapservice,ou=serviceaccounts,dc=ldap,dc=goauthentik,dc=io - Bind Password: The password for the
Service accountyou created earlier - Base DN:
dc=ldap,dc=goauthentik,dc=io - User filter:
(objectClass=user) - Username attribute:
cn
Jellyseerr needs to connect to the Jellyfin server with an account that has admin rights, use the Jellyfin admin user you set up earlier.
- Open the Authentik Admin Interface
- Go to
Applications->Providersand clickCreate - Select
OAuth2/OpenID Providerand clickNext - Enter the following:
- Name:
Jellyseerr Provider - Authorization flow: implicit-consent
- Client type:
Confidential - Redirect URIs/Origins (RegEx):
^https://jellyseerr\.DOMAIN\.COM/login\?provider=authentik&callback=true.* - Subject mode:
Based on the User's username
- Name:
- Take note of your
Client IDandClient Secret, you will need these in the SSO plugin setup in Jellyfin - Click
Finish - Go to
Applications->Applicationsand clickCreate - Enter the following:
- Name:
Jellyseerr - Slug:
jellyseerr - Provider:
Jellyseerr Provider
- Name:
- (Optional) If you want to suppress Jellyfin being listed in the Authentik User Interface set
Launch URLtoblank://blank - Click
Create
- When you first load the page you're met with the setup wizard, click
Configure Jellyfin - Enter:
- Jellyfin URL:
http://jellyfin:8096 - Base URL: Leave blank
- Email: Not related to Jellyfin, use whatever
- Username:
admin - Password: The password you set up for the Jellyfin
adminuser previously
- Jellyfin URL:
- Click
Sign inat the bottom - Click
Sync Librariesand toggle them on, clickContinueat the bottom - Radarr Settings:
- Default Server: Check
- Server Name: Radarr
- Hostname: radarr
- Port: 7878
- API Key: Get from Radarr Settings->General
- Click
Testat the bottom - Quality Profile: Any
- Root Folder: /data/movies
- Enable Scan: Check
- Tag Requests: Check
- Click
Add Serverat the bottom - Sonarr Settings:
- Default Server: Check
- Server Name: Sonarr
- Hostname: sonarr
- Port: 8989
- API Key: Get from Sonarr Settings->General
- Click
Testat the bottom - Quality Profile: Any
- Root Folder: /data/tv
- Season Folders: Check
- Tag Requests: Check
- Click
Finish Setupat the bottom - Go to
Settings->Users - Uncheck
Enable Local Sign-Inand checkEnable OpenID Connect Sign-In - In the popup that appears click
Add OpenID Connect Providerand fill out:- Provider Name: Authentik
- Logo:
https://cdn.jsdelivr.net/gh/selfhst/icons/svg/authentik.svg - Issuer URL:
https://auth.DOMAIN.COM/application/o/jellyseerr - Client ID: Get from Authentik Provider
- Client Secret: Get from Authentik Provider
- Provider Slug:
authentik - Scopes:
email openid profile(it saysComma-separatedbut use spaces) - Allow New Users: Check
- Click
Save Changesat the bottom, then close theConfigure OpenID Connectwindow by clickingClose - Finally go to the bottom and click
Save Changes
Authentik has a community integration for Nextcloud to allow user login and provisioning via Authentik.
Make sure usernames are immutable by going to System->Settings in the Admin Interface and checking that Allow users to change username is OFF.
- Open the Authentik Admin Interface
- Go to
Directory->Groupsand clickCreate - Create a group called
nextcloud Admins, this will control which users are given admin permissions inNextcloud - Create a group called
nextcloud Users, this will control which users are allowed to accessNextcloud(to prevent Nextcloud accounts from being provisioned for users who aren't supposed to have access) - Go to
Customization->Property Mappingsand clickCreate - Select
Scope Mappingand clickNext - Set
NametoNextcloud ProfileandScope nametoprofile - In
Expressionenter the following:# Extract all groups the user is a member of groups = [group.name for group in user.groups.all()] # Nextcloud admins must be members of a group called "admin". # This is static and cannot be changed. # We append a fictional "admin" group to the user's groups if they are a member of "nextcloud Admins" in authentik. # This group would only be visible in Nextcloud and does not exist in authentik. if "nextcloud Admins" in groups: groups = ["admin"] else: groups = [] return { # Display name "name": request.user.name, "groups": groups, # To set a quota set the "nextcloud_quota" property in the user's attributes "quota": user.group_attributes().get("nextcloud_quota", None), # To connect an already existing user, set the "nextcloud_user_id" property in the # user's attributes to the username of the corresponding user on Nextcloud. # Uses the Authentik username if attribute is not set. "user_id": user.attributes.get("nextcloud_user_id", str(user.username)), } - Click
Finish - Go to
Applications->Providersand clickCreate - Select
OAuth2/OpenID Providerand clickNext - Enter the following:
- Name:
Nextcloud Provider - Authorization flow:
implicit-consent - Client type:
Confidential - Redirect URIs/Origins (RegEx):
https://nc.DOMAIN.COM/apps/user_oidc/code(make sure you're using the correct path prefix)
- Name:
- Under
Advanced protocol settings->Scopesselect:authentik default OAuth Mapping: OpenID 'email'authentik default OAuth Mapping: OpenID 'openid'authentik default OAuth Mapping: OpenID 'profile'Nextcloud Profile
- Make sure that
Advanced protocol settings->Subject mode: Based on the User's usernameis selected - Make sure that
Include claims in id_tokenat the bottom is ON - Take note of your
Client IDandClient Secret, you will use this in the Nextcloud stage - Go to
Applications->Applicationsand clickCreate - Enter the following:
- Name:
Nextcloud - Slug:
nextcloud - Provider:
Nextcloud Provider
- Name:
- Click
Create - Click on the recently created application and go to the
Policy / Group/ User Bindingstab - Click
Bind existing Policy / Group / User, select theGroupoption and then select thenextcloud Usersgroup
To map an Authentik user to an existing Nextcloud account give the user an attribute like nextcloud_user_id: NEXTCLOUD_ACCOUNT_NAME. To give a user a quota limit give it an atrtibute like nextcloud_quota: 10 GB.
- Log into the web UI using an admin account, click on the profile icon in the top-right and then click on
Apps - Select the
Integrationcategory to the left and look forOpenID Connect user backend, enable it - Go to the top-right menu again and this time click
Administration Settings - In the left-side menu list click on
OpenID Connect - Click the plus sign under
Registered Providersand enter the following:- Identifier:
Authentik - Client ID: See the Authentik section
- Client secret: See the Authentik section
- Discovery endpoint:
https://auth.DOMAIN.COM/application/o/nextcloud/.well-known/openid-configuration - Scope:
openid email profile - User ID mapping:
user_id - Quota mapping:
quota - Groups mapping:
groups(RequiresUse group provisioningto be checked further down) - Display name mapping:
name(UnderExtra attributes mapping) - Email mapping:
email(UnderExtra attributes mapping) - Use unique user id: Turn this OFF
- Identifier:
To make Authentik the default login method for Nextcloud go to your Nextcloud docker directory and run docker compose exec -u www-data nextcloud php occ config:app:set --value=0 user_oidc allow_multiple_user_backends.
- Open the Authentik Admin Interface
- Go to
Applications->Providersand clickCreate - Select
OAuth2/OpenID Providerand clickNext - Enter the following:
- Name
Paperless Provider - Authorization flow: implicit-consent
- Client type: Confidential
- Redirect URIs/Origins: Strict -
https://paperless.DOMAIN.COM/accounts/oidc/authentik/login/callback/
- Name
- Take note of
Client IDandClient Secret, you will use these when setting up your.envfile later - Expand
Advanced protocol settingsand verify that the selected scopes are:
- authentik default OAuth Mapping: OpenID 'email'
- authentik default OAuth Mapping: OpenID 'openid'
- authentik default OAuth Mapping: OpenID 'profile'
- Click
Finish - Go to
Application->Applicationsand clickCreate - Enter
Name/SlugasPaperless/paperlessand forProviderselect the recently createdPaperless Provider - Click
Create
- qwfqwfg
Authentik can be set up to contain the user//pass for the HTTP logins for the various Servarr apps and to forward credentials to the respective app after authentication via Authentik. This way you can keep authentication activated for each app but still only have to log in once when going through Authentik.
- Go to your Traefik dir and open your
dynamic_config.yml - Create a middleware similar to the one in the general Traefik setup above but including the
authorizationheader (this is required for Authentik to be able to forward the credentials):middlewares: authentik-auth-http: forwardAuth: # Match base url to authentik server container name address: http://authentik-server:9000/outpost.goauthentik.io/auth/traefik trustForwardHeader: true authResponseHeaders: - X-authentik-username - X-authentik-groups - X-authentik-email - X-authentik-name - X-authentik-uid - X-authentik-jwt - X-authentik-meta-jwks - X-authentik-meta-outpost - X-authentik-meta-provider - X-authentik-meta-app - X-authentik-meta-version - authorization - Optionally create a middleware chain similar to above:
middlewares: authentik-http: chain: middlewares: - authentik-auth-http - default-security-headers
For the services where you want to use the HTTP-Basic authentication forwarding via Authentik you need to replace the default authentik middleware chain with the authentik-http created above instead.
- Open the Authentik Admin Interface
- Go to
Directory->Groupsand clickCreate - Set a suitable name, e.g.
Servarr Users - Under
Attributesinput a list of usernames//passwords for the different Servarr apps, e.g.:- prowlarr_user: PROWLARR_USERNAME
- prowlarr_password: PROWLARR_PASSWORD
- sonarr_user: SONARR_USERNAME
- sonarr_password: SONARR_PASSWORD
- etc...
- Click
Create - Click on the recently created group, go to the
Userstab and clickAdd existing user - Click the plus sign, select the users you want to be able to access the Servarr apps, click
Addand thenAddagain - Go to
Applications->Providersand clickCreate - Select
Proxy Providerand clickNext - Set a suitable name, e.g.
Prowlarr Providerand selectimplicit-concentunderAuthorization flow - Click
Forward auth (single application) - Set
External hostto the externally accessible address for the app, e.g.https://prowlarr.DOMAIN.COM - Expand
Authntication settingsand make sure that bothIntercept header authenticationandSend HTTP-Basic Authenticationare ON - Set
HTTP-Basic Username KeyandHTTP-Basic Password Keytoprowlarr_userandprowlarr_passwordrespectively (matching the keys in the list set up above) - Click
Finish - Repeat Provider creation for each individual app in your stack
- Go to
Applications->Applicationsand clickCreate - Set a suitable name, e.g.
Prowlarrand the slug similarly toprowlarr - Under
Providerselect theProwlarr Providercreated previously and clickCreate - Repeat Application creation for each individual app in your stack
- Go to
Applications->Outpostsand openauthentik Embedded Outpostfor editing - Under
Applicationsselect each application created previously and click > to add them to `Selected Applications - Click
Update - The previously created providers should now be listed in the
Providerstab forauthentik Embedded Outpost
Authentik has a community integration for Synology DSM to allow user login via Authentik.
- Open the Authentik Admin Interface
- Go to
Applications->Providersand clickCreate - Select
OAuth2/OpenID Providerand clickNext - Enter the following:
- Name: Synology Provider
- Authorization flow: implicit-consent
- Client type:
Confidential - Redirect URIs/Origins (RegEx):
https://nas.DOMAIN.COM/#/signin(use whatever subdomain you set up in your Traefik dynamic_config.yml) - Subject mode:
Based on the User's username
- Click
Finish - Go to
Applications->Applicationsand clickCreate - Enter
Name//SlugasNAS//nasand select the recently created provider, clickCreate
- Log in to DSM with an admin account
- Go to
Control Panel->Domain/LDAPand click on theSSO Clienttab - Check the
Enable OpenID Connect SSO servicebox and click theOpenID Connect SSO Settingsbutton below it - Enter the following:
- Name:
Authentik - Wellknown URL:
https://auth.DOMAIN.COM/application/o/nas/.well-known/openid-configuration - Application ID: Client ID from the Synology Provider
- Application Key: Client Secret from the Synology Provider
- Redirect URL:
https://nas.DOMAIN.COM/#/signin - Authorization scope:
openid profile email - Username claim:
preferred_username
- Name:
Currently doesn't work properly with DSM <7.2 so TBC...