**Description** <!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. --> ⚒️ Fixes # <!--(issue)--> **⚙️ Type of change** - [ ] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code **🧪 How Has This Been Tested?** <!-- Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration --> **📃 Notes:** <!-- Please enter any other relevant information here --> **✔️ Checklist:** - [ ] ⚖️ My code follows the style guidelines of this project - [ ] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [ ] ⚠️ My changes generate no new warnings - [ ] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [ ] ⬆️ I increased versions for any altered app according to semantic versioning - [ ] I made sure the title starts with `feat(chart-name):`, `fix(chart-name):` or `chore(chart-name):` **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._
5.8 KiB
title
| title |
|---|
| How-To |
This is a quick how-to or setup guide to use Authentik with TrueNAS SCALE and setup a simple Proxy Provider with traefik using the Embedded Outpost to use as a Traefik forwardauth. This guide was created with Authentik 2022.10.0 and will be updated if things dramatically change.
This can be applied to other systems but this specific guide has been tested and created on TrueNAS SCALE and isn't guaranteed to work with any other configs.
Requirements
- Authentik TrueCharts Chart
- Traefik Truecharts Chart
Prerequisites
This guide assumes you're using Traefik as your Reverse Proxy / Ingress provider and have through the configuration listen in our Quick-Start guides and/or the Traefik documents. Please ensure that you can access your domain properly with Ingress before attempting any further steps.
Authentik Chart Setup
:::note
The Authentik chart has many options, which may enhance or break your chart depending on your setup and are beyond the scope of this guide
:::
Container Configuration
All of the defaults are fine to start off, you must choose a password, however ingress must be set if you wish to use authentik with traefik.
Ingress Example
:::note
Note that the *.domain.com host config is only needed if you want to use Forward auth (single application) in authentik.
:::
Authentik GUI Setup
Default username is akadmin and password is whatever you entered in the initial setup.
- Once logged in enter the Admin Interface
Create Application
- First step is to create an Application for use with
authentik
- Specific the
NameandSlugand then chooseCreate Provider
- Choose a new provider
Proxy Provider.
- The simplest is to give it a name and use
Forward auth (domain level). Once there you enter themain ingressURL you use to accessauthentikand thecookie domainas the main domain you use.
- If you want to use subdomain-level access control, select
Forward auth (single application)and enter the URL you have chosen for your apps' ingress. - The example uses
https://application.domain.com/, make sure your app is reachable and uses a valid certificate beforehand. - You can set HTTP-Basic Authentication Attributes under
Authentication settingsfor your service here.- Don't use a
basicAuthmiddleware in the apps' ingress settings. Only use this if your app has build in basic auth support. - Add the attributes in a
authentikgroup, then assign any user you want to be able to access the application to this group.
- Don't use a
- Once done use that new
Provideryou created
Choose Provider
If everything was done properly above, you should have the Provider you created assigned to your Application
Use Embedded Outpost
- Next step is simply attaching your
applicationwith theauthentik Embedded Outpostthat has been created automatically. Click theEditbutton under Actions
- Name your
Outpostand choose theApplicationyou wish to use withauthentik. ClickUpdateand verify it's usage with the Healthcheck below.
Traefik ForwardAuth Setup
Once authentik is setup and running, you must create a forwardAuth inside Traefik in order to use authentication with Traefik. For my purposes auth is what I used but as long as you remember it you're fine.
:::note
The main thing about this screen is to use the internal DNS name for simplicity
- I have successfully used an
authentikinstance on a difference host together withexternal-serviceusing this URL:https://authentik-external-service.ix-authentik.svc.cluster.local:9443/outpost.goauthentik.io/auth/traefik
- Use
heavyscript dns -ato get the internal DNS name for yourauthentikinstance in that case. - I suggest using the
httpsendpoint and port because it is what worked for me.
:::
http://authentik-http.ix-authentik.svc.cluster.local:10230/outpost.goauthentik.io/auth/traefik
Double-check the DNS name and port.
There's also a list of authResponseHeaders inside authentik listed for use with Traefik, so in case you need them here they are.
X-authentik-usernameX-authentik-groupsX-authentik-emailX-authentik-nameX-authentik-uidX-authentik-jwtX-authentik-meta-jwksX-authentik-meta-outpostX-authentik-meta-providerX-authentik-meta-appX-authentik-meta-version
Add the authorization header to pass the HTTP-Basic headers from authentik to you application.
Add Traefik forwardAuth to Charts
- Once that is done all you need to add the
middlewareto your Charts under theIngress section, as in my case it's calledauth.
And that's it.
Verification it works
- Simply visit any
URLthat you haveTraefik+ theforwardAuthmiddleware enabled
- Login and voila!
Support
- You can also reach us using Discord for real-time feedback and support
- If you found a bug in our chart, open a Github issue but generally it's advised to contact us on Discord first in most cases.
All Rights Reserved - The TrueCharts Project















