Signing in with authentik
What this guide sets up
At the end, people sign in to the control plane with their authentik account. authentik groups give them their role in the control plane, and signing out of the control plane signs them out of authentik too. Password sign-in stays on for the local administrator, so you keep a way back in.
The steps were tested in this order against authentik 2026.8. Single sign-on explains every control plane setting in detail; this guide is the order to do them in.
The examples use these values. Replace them with yours:
| Value | Example |
|---|---|
| The control plane's address, as people open it | https://192.168.0.63:3443 |
| authentik's address | https://192.168.0.63:9543 |
| The application's slug | onprem-ai |
| The groups | onprem-ai-admins, onprem-ai-operators, onprem-ai-viewers |
Before you start
- The control plane is reached over HTTPS. Open the control plane at its
https://address. - authentik is reached over HTTPS, with a certificate for the address you use. authentik's own web server picks its certificate by the name the client asks for. A client that dials a plain IP address asks for no name, and authentik then presents its built-in self-signed certificate, which nothing trusts. With a plain IP address, put authentik behind a reverse proxy that presents your certificate for that address (Caddy, nginx, Traefik); with a DNS name, set the certificate on the brand (System → Brands, Web Certificate).
- The clocks are correct. The control plane allows 2 minutes of difference between the two machines.
- You know the redirect URI. Sign in to the control plane as an administrator, open Configuration → Access → Sign-in, and copy the redirect URI, for example
https://192.168.0.63:3443/api/auth/oidc/callback. It is built from the address in your browser, so open the control plane at the address people will use.
Step 1: The groups and the users in authentik
In authentik's Admin interface:
- Directory → Groups → Create: create
onprem-ai-admins,onprem-ai-operatorsandonprem-ai-viewers. You need only the groups for the roles you use. - Add each person to the group of their role: Directory → Users → the user → Groups → Add to existing group. A person in several groups gets each role.
Step 2: The provider for the control plane
Applications → Providers → Create → OAuth2/OpenID Provider, then:
- Provider Name:
onprem-ai. - Authorization Flow:
default-provider-authorization-implicit-consent, so people see no consent page for your own application. - Client Type: Confidential. Copy the Client ID and the Client Secret.
- Grant Types: Authorization Code must be ticked. The form ticks several by default; the control plane uses only this one, and you may untick the others.
- Redirect URIs/Origins: two entries, both Strict:
- Authorization: the redirect URI from the Configuration page,
https://192.168.0.63:3443/api/auth/oidc/callback; - Post Logout: the control plane's address followed by
/signed-out,https://192.168.0.63:3443/signed-out. When people open the control plane at more than one address, add both entries for each one.
- Authorization: the redirect URI from the Configuration page,
- Signing Key:
authentik Self-signed Certificate(any key works: the control plane reads it from authentik's published keys). - Under Advanced flow settings, Invalidation Flow:
default-invalidation-flow. The default,default-provider-invalidation-flow, ends only the application's session: authentik's own session stays, and the next sign-in to the control plane needs no password. - Under Advanced protocol settings:
- Selected Scopes:
openid,emailandprofile. The groups come in theprofilescope'sgroupsclaim; withoutprofile, everyone signs in as a viewer. - Include claims in id_token: on. The control plane reads the username, the email address and the groups from the ID token; without them, a person who signs in for the first time is refused ("did not say who you are").
- Selected Scopes:
Click Finish.
Step 3: The application
Applications → Applications → Create: Name onprem.ai, Slug onprem-ai, Provider onprem-ai. The slug is part of the issuer URL.
Check the issuer: open https://192.168.0.63:9543/application/o/onprem-ai/.well-known/openid-configuration. Its issuer is https://192.168.0.63:9543/application/o/onprem-ai/, with a / at the end.
Step 4: Trust authentik's certificate on the control plane
Skip this step when authentik's certificate comes from a public certificate authority.
When it comes from your own certificate authority, copy that authority's certificate into the folder /etc/onprem-ai/trusted-certificate-authorities/ on the control plane's machine (Trusting your own certificate authority):
sudo install -d -m 0755 /etc/onprem-ai/trusted-certificate-authorities
sudo cp your-ca.pem /etc/onprem-ai/trusted-certificate-authorities/
sudo chmod 0644 /etc/onprem-ai/trusted-certificate-authorities/your-ca.pem
Nothing else is set. Then run sudo onprem-ai-ctl restart.
Step 5: Connect the control plane
Do this on the Configuration page, or from the deployment. Choose one: settings from the deployment replace the Configuration page's settings.
On the Configuration page
- Open Configuration → Access → Sign-in.
- Enter:
- Issuer URL:
https://192.168.0.63:9543/application/o/onprem-ai/, with the/at the end, exactly as authentik states it. - Client ID and Client secret: from step 2.
- Name on the sign-in button: for example
Company login. - Administrator group
onprem-ai-admins, operator grouponprem-ai-operators, viewer grouponprem-ai-viewers. - Account management URL:
https://192.168.0.63:9543/if/user/, authentik's page where people change their password. It shows as Account in their user menu.
- Issuer URL:
- Click Test connection. It tests what you typed, before you save it. authentik offers no
groupsscope, so the test says that sign-in does not ask for it and warns that it cannot see whether the groups arrive: step 2 sends them in theprofilescope, and step 6 checks it. - Under Login methods, tick Single sign-on, keep Password ticked, and click Save single sign-on settings.
From the deployment
On the control plane's machine, as root: write the client secret into /var/lib/onprem-ai/control-plane/secrets/oidc_client_secret (owner 1000, mode 0400, as Single sign-on shows), add these lines to /etc/onprem-ai/control-plane/config.env, and apply them with sudo onprem-ai-ctl apply:
LOGIN_METHODS=local,oidc
OIDC_ISSUER_URL=https://192.168.0.63:9543/application/o/onprem-ai/
OIDC_CLIENT_ID=<client id from step 2>
OIDC_CLIENT_SECRET_FILE=/run/secrets/oidc_client_secret
OIDC_ADMINISTRATOR_GROUP=onprem-ai-admins
OIDC_OPERATOR_GROUP=onprem-ai-operators
OIDC_VIEWER_GROUP=onprem-ai-viewers
OIDC_DISPLAY_NAME=Company login
OIDC_ACCOUNT_URL=https://192.168.0.63:9543/if/user/
Step 6: Check that it works
Open the control plane's login page in a private browser window, at the address you registered in step 2.
- Click Sign in with Company login, and sign in at authentik as a member of
onprem-ai-admins. You come back to the control plane, signed in. - Open Configuration → Access → Users. The person is listed with the role administrator.
- Sign in once as a member of each other group, and once as someone in none of the three: an operator, a viewer, and a viewer.
- Click Logout. The browser goes to authentik and comes back to a page that says you are signed out. Click Sign in with Company login again: authentik asks for the password again.
Optional: Only some people may sign in
Enter a group as the allowed group (OIDC_ALLOWED_GROUP). Only its members may sign in; everyone else comes back to the login page with a message telling them to ask their administrator. Put everyone who may sign in into it, administrators and operators included.
When it does not work
| What you see | Why | What to do |
|---|---|---|
| Test connection says the identity provider states another issuer | The issuer URL lacks the / at the end, or names another slug | Enter the issuer exactly as the test names it |
| Test connection says the certificate is not trusted, while a browser trusts authentik | authentik presents its self-signed certificate to a client that dials its IP address | Put a reverse proxy with your certificate in front of authentik (Before you start) |
| Test connection says the certificate is not trusted, and authentik's certificate is your own authority's | The control plane does not trust that authority yet | Do step 4 |
The login page says authentik refused the sign-in request; the audit log says invalid_request | Authorization Code is not among the provider's Grant Types | Tick it (step 2) |
The login page says authentik refused the sign-in request; the audit log says invalid_client | The client ID or the client secret is wrong | Copy both from the provider again |
Everyone is a viewer, also members of onprem-ai-admins | The profile scope is not among the provider's scopes | Add it (step 2) |
| The login page says authentik did not say who you are | Include claims in id_token is off | Turn it on (step 2) |
| After Logout, the next sign-in needs no password | The provider's Invalidation Flow is default-provider-invalidation-flow | Choose default-invalidation-flow (step 2) |
| authentik shows an error about the redirect URI | The address in the browser is not among the provider's Authorization redirect URIs | Add the redirect URI the Configuration page shows for this address |