11.2 Sign-in and OIDC
Sign-in to the web interface uses a local account (user name and password, optionally with a second factor) or single sign-on through an OIDC identity provider such as Authentik, Keycloak, or Entra ID. OIDC is optional and set up in server.toml.
Local sign-in
On first start the page First start: create the administrator account asks for User name, Password (at least 12 characters), and Repeat password, and Create account and sign in creates the first admin account. An admin creates further accounts (see section 11.1 Users and roles).
After that the sign-in page asks for User name and Password. Sign in starts the session. If the account has a second factor, the step Second step for … follows: either enter the Code from the authenticator app, or choose Use a recovery code instead and enter one of the recovery codes (format xxxx-xxxx, each works once), then finish with Verify. A disabled account gets the message "This account is disabled. Ask an administrator to enable it."
A session lasts session_hours hours from sign-in (default 12, allowed 1 to 720). The session cookie __Host-pdc_session is Secure, HttpOnly, and SameSite=Strict. Disabling an account, or resetting its password or second factor, ends its sessions at once.
Lockout after failed attempts
Repeated wrong sign-ins lead to growing waiting times so that passwords cannot be guessed:
Counter | Limit | Waiting time |
|---|---|---|
User name and client address together | 5 failed attempts | doubles with each further failure, at most 15 minutes |
Client address alone | 10 failed attempts | as above, at most 15 minutes |
User name from anywhere | 50 failed attempts (soft limit) | at most 60 seconds |
This way an attacker on another address cannot lock the real account out for long. Failures in the second step are counted separately. A successful sign-in resets the counters.
Single sign-on with OIDC
PDC-Backup supports OIDC with the authorization code flow and PKCE (S256). The server verifies the ID token against the provider's keys (JWKS; RS256 and ES256) as well as iss, aud, exp, iat, and nonce, and then creates a normal session. If [oidc] is configured, the sign-in page shows the button Sign in with … (label from label, otherwise "single sign-on") in addition to the form. A failed sign-in appears as "Single sign-on failed: …".
Setup
At the identity provider, create a client for PDC-Backup and register
https://<server>:8443/api/v1/auth/oidc/callbackas redirect URI. The provider must offer a discovery document at<issuer>/.well-known/openid-configuration.Add an
[oidc]section toserver.tomlin the server's data directory (see below).Restart the server so that it re-reads the file. Only the
[oidc]section turns the feature on.
Fields of the [oidc] section
Option | Effect | Default |
|---|---|---|
| Address of the identity provider. The | – |
| Identifier of the client at the provider. The ID token must be issued for it ( | – |
| Secret of a confidential client (sent as | empty |
| Exactly the return address registered at the provider: | – |
| Additional scopes. | empty (only |
| Claim with the user name. If it is missing or empty, the server tries | empty |
| Claim with group or role names (text or list), for example | empty (then |
| Table | empty |
| Role when no value is mapped. Empty: the sign-in is refused (403, "your account has no role in PDC-Backup"). | empty |
| Creates accounts on first sign-in. Off: only already linked OIDC accounts may sign in. |
|
| Label of the sign-in button. | empty (shown as "single sign-on") |
| Allows provider addresses with |
|
[oidc]
issuer = "https://auth.example.com/application/o/pdc/"
client_id = "pdc-backup"
client_secret = "…" # empty for public clients (PKCE only)
redirect_url = "https://backup-pc:8443/api/v1/auth/oidc/callback"
scopes = ["profile", "email", "groups"]
role_claim = "groups"
create_users = true
label = "Company account"
[oidc.role_map]
"backup-admins" = "admin"
"family" = "restore"
What happens at sign-in
Accounts are linked by provider and subject (
sub), not by name. On the first login the server creates the account (withcreate_users = true). The name comes from the claim; characters other than letters, digits, and._-@become_, at most 64 characters. If the name is taken, the server appends-oidc; if that is taken too, the sign-in fails with a conflict.The role follows the provider at every sign-in. If the provider changes the groups, the role changes at the next login. The rule "at least one active admin" still applies.
OIDC accounts have no local password and cannot sign in with a password. The second factor is up to the provider; in the user list they show the badge SSO.
A disabled account is refused (403).
The sign-in is bound to the browser that started it (cookie
pdc_oidc, valid for 10 minutes,HttpOnly,Secure,SameSite=Lax). The server refuses a return from another browser (401).Every sign-in is in the audit log (
auth.login, detailoidc), new accounts asuser.created_oidc(see section 11.4 Audit log).