Guides
Signing in with SSO
By the end of this page the sign-in screen has a button such as "Sign in with Authentik", and existing NPG accounts are linked to their accounts at that provider. Password sign-in stays available.
This is about signing in to the NPG admin UI. Putting an authentication server in front of a proxy host is ForwardAuth.
Before you start
- You need a provider that supports OpenID Connect. The presets are Google, Authentik, Authelia and Keycloak; any other provider uses Enter manually.
- The NPG API container must be able to reach the provider's address. If NPG itself proxies the provider, check that the provider's domain resolves from inside the NPG server too.
- Google accepts only
https://callback URLs on a real domain. If you reach the admin UI by IP address or overhttp://, make it reachable on a domain with a certificate before adding Google.
1. Add the provider
- In Settings → SSO, click Add provider.
- Under Which provider?, pick a preset. A guide for that provider appears (for example At Authentik, do this), with the callback URL already filled in with its real value.
- Fill in Connection:
- Display name: the name on the sign-in button
- Identifier: used in the URL. Lowercase letters, digits and hyphens.
- Issuer URL: the provider's discovery base address. Each preset shows the expected form. For authentik, paste the address ending in
/, such ashttps://auth.example.com/application/o/<slug>/, as it is. - Client ID, Client secret: the values issued by the provider
- Scopes: the default includes
openid,profileandemail. Addgroupsif you restrict access by group or map groups to roles.
- Copy the Callback URL shown on the screen and register exactly that value at the provider. It has the form
https://<admin UI address>/api/v1/auth/sso/<identifier>/callback. A single character of difference fails the sign-in. If NPG sits behind another proxy and sees a different address, put the public address in Callback base URL under Advanced. - Click Test connection. It should say "Connected. This provider is usable."

2. Decide who may sign in
Set this under Who may sign in, and as what?
- Allowed email domains, Allowed emails, Required group: limit who can sign in.
- Create an account the first time someone signs in: creates an account for someone with no NPG account on their first sign-in. It only turns on once at least one of allowed email domains, allowed emails or required group is set, because being authenticated is not the same as being allowed into this panel.
- Group to role mappings: map a group name at the provider to an NPG role (Administrator, Operator, Viewer, or one you created). With mappings set, the role is recomputed at every sign-in, so removing a group at the provider takes effect on the next login. Without mappings, the role is set once when the account is created and NPG owns it from then on.
- Default role: the role for newly created accounts, and the fallback when the groups match no mapping.
Make sure Use this provider is on, then save. The button appears on the sign-in screen.
3. Link existing accounts
There is no button for linking an existing account. If the provider reports a verified email that matches an existing NPG account's email, the account is linked automatically on the first SSO sign-in. A linked account keeps its history, role and password sign-in. Once linked, the link holds even if the email later changes.
- In Settings → Users, click the account.
- Set Email to the address the provider holds. The comparison ignores case and nothing else. An address marked No SSO is one NPG made up, so it can never match a provider.
- Sign out and sign in with the SSO button on the sign-in screen.

Password sign-in and two-factor authentication
- Password sign-in cannot be turned off. NPG is often the reverse proxy in front of the very provider you configure, so an SSO-only panel would lock you out of the tool you need to fix it.
- Signing in through SSO does not ask for NPG's own two-factor code. The provider performs the authentication, so set up two-factor authentication at the provider if you need it.
Check that it works
- The sign-in screen has a button with the display name, such as Sign in with Authentik.
- After signing in with it, open the account under Settings → Users: the provider appears in its list of linked sign-in providers.
- In the Settings → SSO list, the provider's linked account(s) count goes up.
Common problems
When a sign-in is refused, the API log records why. The email address itself is never logged, only whether one was present and whether it was verified.
docker logs npg-api 2>&1 | grep "SSO"| Message on screen or in the log | Cause and fix |
|---|---|
| Could not reach the identity provider. | NPG could not fetch the discovery document from the Issuer URL. Check the address with Test connection, and that the API container can reach that domain. |
No NPG account is linked to this identity. / log shows email present=true, verified=true, jit=off | No NPG account has the email the provider sent. Set the matching email in Settings → Users. |
Log shows verified=false | The provider sends the email as unverified. Mark the email verified at the provider, or use Trust this provider's email addresses from the note above. |
| The provider returned no email address. | Check that Scopes includes email and that the provider puts the email in the ID token or UserInfo. |
| This identity is not permitted to sign in. | The allowed email, domain or required group conditions did not match. If you use a group condition, check that Scopes includes groups; without it most providers send no group information and every sign-in is refused. |
Log shows matched the provider only as ... | The trailing / of the Issuer URL differs from the provider's form. Sign-in works, but saving the form shown in the log avoids the retry each time. |
If you cannot get into the admin UI at all, see Admin account recovery and 2FA.