Contact
Skip to the page text

Documentation / Guides / Authentication

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:

ValueExample
The control plane's address, as people open ithttps://192.168.0.63:3443
authentik's addresshttps://192.168.0.63:9543
The application's slugonprem-ai
The groupsonprem-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:

  1. Directory → Groups → Create: create onprem-ai-admins, onprem-ai-operators and onprem-ai-viewers. You need only the groups for the roles you use.
  2. 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.
  • 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, email and profile. The groups come in the profile scope's groups claim; without profile, 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").

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

  1. Open Configuration → Access → Sign-in.
  2. 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 group onprem-ai-operators, viewer group onprem-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.
  3. Click Test connection. It tests what you typed, before you save it. authentik offers no groups scope, 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 the profile scope, and step 6 checks it.
  4. 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.

  1. 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.
  2. Open Configuration → Access → Users. The person is listed with the role administrator.
  3. 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.
  4. 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 seeWhyWhat to do
Test connection says the identity provider states another issuerThe issuer URL lacks the / at the end, or names another slugEnter the issuer exactly as the test names it
Test connection says the certificate is not trusted, while a browser trusts authentikauthentik presents its self-signed certificate to a client that dials its IP addressPut 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'sThe control plane does not trust that authority yetDo step 4
The login page says authentik refused the sign-in request; the audit log says invalid_requestAuthorization Code is not among the provider's Grant TypesTick it (step 2)
The login page says authentik refused the sign-in request; the audit log says invalid_clientThe client ID or the client secret is wrongCopy both from the provider again
Everyone is a viewer, also members of onprem-ai-adminsThe profile scope is not among the provider's scopesAdd it (step 2)
The login page says authentik did not say who you areInclude claims in id_token is offTurn it on (step 2)
After Logout, the next sign-in needs no passwordThe provider's Invalidation Flow is default-provider-invalidation-flowChoose default-invalidation-flow (step 2)
authentik shows an error about the redirect URIThe address in the browser is not among the provider's Authorization redirect URIsAdd the redirect URI the Configuration page shows for this address

Found a mistake, or is something missing? Suggest an improvement to this page on GitHub.

Platform release 5.10.4, . Source of this page at v5.10.4. This page as Markdown.