Single sign-on (OIDC)
Under Settings › Single sign-on (OIDC) you connect an
identity provider (Authentik, Keycloak, Entra ID, Google, …). The login page then shows an
additional button ("Sign in with …"). At the provider you need a client with the
Authorization Code flow (OPNexus additionally uses PKCE) and enter the displayed
redirect URI there (https://<your-opnexus>/api/auth/oidc/callback). In OPNexus you enter
issuer URL, client ID, client secret and the group names that map to the roles Admin, Operator
and Read-only. "Test provider" checks discovery and signing keys.
- Role from groups, at every login: the list of groups under Settings › Single sign-on (group → role, any built-in or own role) is read from top to bottom and the first row that matches applies; whoever is in none of the groups does not get in (and no account is created). If someone is removed from the group, access ends at the next login (running SSO sessions end after 12 hours at the latest; people blocked at the provider should therefore also be deleted in the user list).
- Accounts: SSO users are created at their first login (marked "SSO"). Role and password
change only at the provider; the provider handles two-factor login. An SSO account is never linked with
a local account of the same name: in case of a name conflict it gets a suffix (
~sso). - Local accounts remain: login with user name and password keeps working, e.g. for an emergency if the provider fails.
- Verified are the signature (asymmetric algorithms only, never
noneor HMAC), issuer, audience, expiry and nonce of the ID token; every login attempt (state) is valid exactly once and for 10 minutes and is bound by a cookie (with HTTPS__Host-opnexus-oidc-state) to the browser that started it; a call without this cookie always fails. Groups come from the ID token, alternatively from the userinfo endpoint. Issuer and endpoints must behttps://. This is tested against an imitated provider (including forged tokens) and against real servers of Keycloak 26 and Authelia 4.39 (login, roles from groups, role removal, intercepted callback); other providers: report what does not work with yours. The default scopes areopenid profile email; the groups must arrive as a claim in the ID token or userinfo (Keycloak: "Group Membership" mapper on the client; Entra ID: optional groups claim). Providers that only send groups on request (e.g. Okta, Authelia) additionally need the scopegroups.