Skip to Content
Admin GuidesLedgerAuthentication

Authentication

Ledger supports four ways for a user to sign in:

  1. Local accounts: a username and password stored in the Ledger database.
  2. LDAP or Active Directory: credentials verified against a directory server.
  3. SAML 2.0 single sign-on: authentication delegated to an external identity provider (IdP) such as Auth0, Okta, Microsoft Entra ID, AD FS, or Keycloak. See SAML authentication.
  4. OpenID Connect (OIDC): authentication delegated to an OpenID Connect provider such as Keycloak, Okta, Microsoft Entra ID, Auth0, Google Workspace, or Authentik, using the OAuth 2.0 authorization code flow.

LDAP, SAML, and OpenID Connect can be enabled independently or together, and all four methods can be active at the same time.

Where to configure authentication

All authentication settings are under Settings > Authentication, which only administrators can open. The page has four tabs: Local, LDAP, SAML, and OpenID Connect. Settings take effect on the next sign-in attempt, without a restart.

The Session Timeout and Primary Administrator settings are under Settings > General.

How Ledger chooses a sign-in method

When a user submits the login form, Ledger decides how to authenticate them based on whether an account already exists and which integrations are enabled:

  • Existing LDAP account: the password is verified against the directory. LDAP must be enabled and the account must not be disabled.
  • No account, LDAP enabled: Ledger attempts an LDAP bind and, on success, creates a new LDAP account automatically.
  • Existing local account: the password is verified against the stored hash, then the local password policy is applied (inactive account expiry, password expiry, and the complexity of the existing password).
  • Existing SAML or OpenID Connect account: the login form always rejects it. These accounts have no local password and must sign in through their identity provider.
  • SAML is never started from the username and password form. It is a separate flow started from the Log in with SAML button, which appears on the login page only when SAML is enabled, or from your IdP.
  • OpenID Connect is also a separate flow, started from the Log in with OpenID Connect button, which appears only when OpenID Connect is enabled. It must start at Ledger; sign-in started from the provider is not supported.

Repeated failed logins from the same IP address are rate limited: 10 failures within 15 minutes block that address for 15 minutes.

Session timeout

A login session ends after a configurable period of inactivity. Set the timeout under Settings > General > Session Timeout. It applies to every sign-in method.

Session Timeout setting with its choices open

The choices are 15 minutes, 30 minutes, 1 hour (the default), 2 hours, 4 hours, and 8 hours. The CIS Password Policy Guide recommends 15 minutes or less. A change takes effect on each user's next request; it does not sign anyone out.

How the timeout works:

  • Sliding window: every request a signed-in user makes, including background page updates, resets the expiry, so the timeout counts from the user's last request, not from login.

  • Enforced by the server: a request that arrives after the window has elapsed finds no valid session, and the user is sent to the login page, whatever the browser did.

  • Warning in the browser: two minutes before expiry, Ledger shows a Your session is about to expire dialog with a countdown. Stay Logged In extends the session and Logout signs out immediately. If the user does nothing, Ledger signs them out and the login page shows Your session has expired due to inactivity. Please log in again.

    Session expiry warning with a countdown

    Login page after an inactivity timeout

  • Multiple tabs: before warning and again before signing out, the page checks with the server how much time the session really has left, so activity in another tab keeps every tab signed in.

  • SAML users: an inactivity timeout still performs SAML single logout at the IdP when it is configured. See Logging out.

  • API clients: requests authenticated with HTTP Basic credentials do not use a session and are not affected.

Primary administrator

Every installation has one primary administrator: the local account that can always be used to get back in. This account:

  • Is exempt from Expire Inactive Accounts under Settings > Authentication > Local, so enabling account expiry can never lock every administrator out.
  • Can never be disabled. The Enabled setting is not offered for it under Admin > Users, and a request to disable it is refused.
  • Can never be deleted. The user list shows no delete button for it.

It can be renamed, given a new email address or password, and have its teams and permissions edited like any other account.

Choose the primary administrator under Settings > General > Primary Administrator. The default is the built-in admin account. Only enabled local accounts can be selected; LDAP, SAML, and OpenID Connect accounts are owned by the directory or identity provider. When you select a different account, the protections move to it, and the previous primary administrator becomes an ordinary account (subject to Expire Inactive Accounts from its next login). If the selected account ever stops being an enabled local account, for example after a database restore, the built-in admin account is treated as the primary administrator until you change the setting.

The Primary Admin Name and Primary Admin Email fields under Settings > Mail are separate settings: they set the sender of outgoing email and the recipient of security notifications.

Local accounts and password policy

Local accounts store a salted hash of the password in the Ledger database. Administrators create them under Admin > Users > Add User (see Administration), and users change their own password on the Profile page.

The Local tab under Settings > Authentication sets the password policy for every local account. It does not apply to LDAP, SAML, or OpenID Connect accounts, whose passwords are owned by the directory or identity provider.

Local password policy settings with example values

The values in the screenshot are an example that exercises every control, not a compliance recommendation. Choose values from your own policy. For reference, the current CIS Password Policy Guide asks for at least 14 characters where a password is the only factor, prefers changing passwords on evidence of compromise rather than on a fixed schedule (with an annual backstop at most), and recommends locking inactive accounts after 45 days. A CIS-aligned site would therefore typically set Minimum Length to 14 or more, leave Expire Password at Disabled or 1 year, and set Expire Inactive Accounts to 45 days. Whatever the values, turn on Notify Primary Admin after you set the Primary Admin Email (see Email).

Local settings

SettingDefaultDescription
Minimum Length8Minimum number of characters, from 1 to 128. Multi-byte characters count once.
Require Mix CaseOnNew passwords must contain both upper and lower case letters.
Require NumberOnNew passwords must contain at least one digit.
Require Special CharacterOnNew passwords must contain at least one character that is neither a letter nor a digit, such as punctuation, a symbol, or a space.
Force Complexity Upon Old PasswordsOffAt login, an existing password that fails the complexity rules forces a password change before the user can continue.
Expire Inactive AccountsDisabledLocal accounts that have not logged in for this many days (30, 45, 60, 90, or 120 days, 1 year, or 2 years) are disabled at their next login attempt. Accounts that have never logged in are not affected, and the primary administrator is exempt.
Expire PasswordDisabledPasswords older than this many days (30, 60, 90, 120, or 180 days, or 1 year) must be changed at the next login.
Password HistoryDisabledRemember this many previous passwords (1 to 12) and refuse to reuse any of them. The current password can never be reused, even when history is disabled.
Notify Primary AdminOffQueue an email to the Primary Admin Email for each security event. See Security notifications.
Minimum Password AgeDisabledHow long users must wait after changing their password before they may change it again themselves (1, 4, or 12 hours, or 1, 2, 3, 7, 14, or 30 days). A change required by policy or set by an administrator is always allowed.

Settings take effect for the next password change or login.

How the policy is enforced

The server checks every new local password against the policy; the checks in the browser are a convenience only.

  • Profile page: users must enter their current password, confirm the new one, meet the complexity rules, avoid their password history, and respect the minimum password age. On success, every session of the user ends and they sign in again with the new password.
  • Admin > Users (add or edit): the same complexity and history rules apply to passwords set by an administrator. The minimum age does not, because an administrator reset is meant to be immediate. Setting a password from the edit page ends the user's other sessions. Both forms offer Require Password Change at Next Login.
  • Login: after a correct password, the inactive account rule is checked first. If the account has lapsed, it is disabled and the login is refused (the primary administrator is never disabled this way). Then, if the password has expired, or fails the current rules while Force Complexity Upon Old Passwords is on, the user must change it before doing anything else.
  • REST API: a local user whose password change is pending, or whose password has expired, receives 403 PASSWORD CHANGE REQUIRED until they change it in the web interface. Requests with HTTP Basic credentials also apply Expire Inactive Accounts (a lapsed account is disabled and receives 403 ACCOUNT DISABLED) and count as a login for that policy.

The requirements list under each password field is generated from the saved policy, and the form checks length, case, digits, special characters, and the confirmation as you type.

Profile page checking a new password against the policy

Add User form with the password requirements and the Require Password Change at Next Login switch

Forced password changes

While a password change is pending, or while the password has expired (even during a session that is still open), every page other than Profile and Logout redirects to the Profile page, which shows You must change your password before continuing. A change the policy requires is never held back by Minimum Password Age. The requirement is cleared when the user changes their password, or when an administrator sets a new password with Require Password Change at Next Login turned off.

Profile page showing a required password change

Password history and minimum age

Ledger keeps the hashes of each user's previous passwords, up to the Password History size, and compares new passwords against them and the current password. When history is Disabled, the stored history is cleared at the next change.

The time of the last password change drives both Expire Password and Minimum Password Age. Accounts that existed before the policy was introduced are treated as having changed their password at upgrade time, so enabling expiry never forces every user to change at once. While the minimum age is in force, the Profile page disables the password fields and shows when the next change is allowed.

Security notifications

With Notify Primary Admin turned on, these events queue an email to the Primary Admin Email:

EventWhen
Login lockout triggeredThe failed login throttle blocks a source address (10 failures within 15 minutes; blocked for 15 minutes). One message per lockout.
Inactive account disabledA local account is disabled by Expire Inactive Accounts at its next login attempt.
Password change required at loginA login requires a change because the password expired, or fails the complexity rules while Force Complexity Upon Old Passwords is on.
Password changedA user changes their own password, or an administrator sets a user's password.

Messages are sent from the Primary Admin Email with the Primary Admin Name as the sender name, using the SMTP settings under Settings > Mail. Notifications are skipped while Enable Email is off or the Primary Admin Email is empty. See Email.

LDAP and Active Directory

LDAP settings

LDAP tab of the Authentication settings

SettingRequiredDescription
Enable LDAPTurns LDAP on. When off, LDAP is never consulted.
LDAP ServerYesFull URL to the server, including the scheme: ldaps://host (LDAP over TLS, port 636) or ldap://host (port 389). A port may be appended, for example ldaps://host:636.
Base DNFor attribute and group lookupsThe base of the directory tree used to search for users and groups, for example dc=example,dc=com or cn=users,dc=example,dc=com.
User DNYesThe DN template used to bind (authenticate) the user. The token <username> is replaced with the login name. For example, uid=<username>,cn=users,dc=example,dc=com for OpenLDAP, or <username> alone when the server accepts a userPrincipalName or sAMAccountName bind, which is common with Active Directory.
Bind AccountRecommended; required for one-time passwordsService account DN used to look up users, verify group membership, and test the connection. Users are never authenticated with this account.
Bind PasswordWith Bind AccountPassword for the bind account, stored encrypted. The field shows [ saved ] or [ not saved ]; leave it blank when saving to keep the existing value.
Require Group [ Optional ]NoIf set, users must be members of this group to log in. Enter the group name only, for example LedgerUsers, not a full group DN.
Server CA Certificate [ Optional ]NoPEM-encoded CA certificate used to verify the server's TLS certificate.

How LDAP authentication works

  1. Connect: Ledger connects to the LDAP Server with a 5-second timeout. An ldaps:// connection uses TLS from the start. For ldap://, Ledger upgrades the connection with StartTLS before binding (Active Directory rejects plaintext simple binds); if the server does not support StartTLS, Ledger logs it and continues without encryption.
  2. Verify the certificate: if a Server CA Certificate is provided, it is used to verify the server certificate. If none is provided, certificate verification is skipped, to stay compatible with internal servers that use self-signed certificates. Provide the CA certificate in production.
  3. Bind: with a Bind Account (and Base DN), Ledger binds as the bind account, confirms the user exists, checks Require Group, and only then binds as the user with the supplied password. This keeps the presence and group checks working when users log in with a one-time or MFA password, which can only be used once, and is the recommended configuration. Without a bind account, Ledger binds directly as the user and runs the group check on the user's own connection; one-time passwords are not supported in this mode.
  4. Check the required group: if Require Group is set, membership is checked with an Active Directory style query (including nested groups) and an OpenLDAP posixGroup query. If the user is not a member, the login is denied.
  5. Read attributes: Ledger reads the user's entry, by DN when the User DN resolves to one, or otherwise by a subtree search under the Base DN that matches uid, userPrincipalName, sAMAccountName, or cn. The display name comes from the first non-empty attribute of gecos (the part before the first comma), displayName, name, cn, fullName, givenName, and sn. The email comes from mail, email, or userPrincipalName. If none is found, the username is used for both.
  6. Create or update the account: Ledger creates or updates an LDAP account with the resolved name and email. LDAP users never have a usable local password.
  7. Sync teams: see the next section.

LDAP group to team mapping

Under Admin > Teams, each team has an optional LDAP Group DN field. On every LDAP login, Ledger reconciles the user's teams:

  • For each team that has an LDAP Group DN, the user is added to the team if they are a member of that group and removed if they are not.
  • Teams with no LDAP Group DN are left untouched, so you can still manage some teams by hand.

Testing the LDAP connection

The Test button on the LDAP tab connects and binds with the Bind Account and Bind Password, and reports success or failure. When no bind account is configured, the test performs an anonymous bind to check that the server is reachable. The test uses the saved settings, so save before testing. Detailed steps are written to the Ledger web service log.

LDAP troubleshooting

  • Could not connect to the LDAP server: the host, scheme, or port is wrong, a firewall is in the way, or the TLS handshake failed. For a certificate error, provide the Server CA Certificate.
  • Bind fails but the username and password are correct: check the User DN template. For Active Directory, <username> alone (a userPrincipalName such as user@domain) or cn=<username>,... are common; for OpenLDAP it is usually uid=<username>,....
  • Wrong name or email imported: turn on debug logging and review the logged attributes. Make sure the Base DN is correct so the attribute search can find the entry.
  • User denied unexpectedly: check Require Group. The debug log shows the group membership queries and their results.

SAML

Ledger acts as a SAML 2.0 service provider. It supports sign-in started from Ledger or from your IdP, and single logout. For the settings, attribute and group mapping, and troubleshooting, see SAML authentication.

OpenID Connect

Ledger acts as an OpenID Connect relying party, using the OAuth 2.0 authorization code flow with an optional PKCE challenge. The provider's endpoints and signing keys are discovered automatically from the issuer URL, so there are no certificates to exchange.

OpenID Connect settings

OpenID Connect settings configured for a Keycloak realm

General settings:

SettingDefaultDescription
Enable OpenID ConnectOffTurns OpenID Connect on. When on, the login page shows a Log in with OpenID Connect button.
Use PKCEOnSends a Proof Key for Code Exchange (S256) challenge with the authorization request, binding the authorization code to this browser session. Leave it on unless your provider rejects it. Required when no Client Secret is configured (a public client).

Identity Provider Information:

SettingRequiredDescription
Issuer URLYesThe provider's issuer, for example https://idp.example.com/realms/ledger. Ledger reads the provider's endpoints from the issuer's /.well-known/openid-configuration document. The iss claim in every ID token must equal this value exactly, with no trailing slash. It must use https://; plain http:// is accepted only for localhost and loopback addresses.
Client IDYesThe client or application ID registered at the provider. The ID token audience must contain it.
Client SecretConfidential clientsThe client secret, stored encrypted. Leave the field blank when saving to keep the stored value. It can be omitted for a public client when Use PKCE is on.
ScopesNoSpace-separated scopes to request. The default is openid profile email groups, and openid is always added. Remove groups for providers that do not define that scope, such as Google and Auth0.
Logout URL [ Optional ]NoOverrides the provider's discovered end-session endpoint. Set it only when discovery does not advertise one. Must use https://, like the issuer URL.
Server CA Certificate [ Optional ]NoA PEM CA certificate to trust, in addition to the system roots, when the provider uses a private certificate authority.

Relying Party Information:

SettingDefaultDescription
Redirect URLDerived from the Ledger Base URLThe public callback URL the provider redirects the browser to. It must use https:// (loopback http:// excepted), must end in /oidc/callback, for example https://ledger.example.com/oidc/callback, and must be registered exactly as a redirect URI at the provider.
Username Claimpreferred_usernameClaim that holds the login name.
Email ClaimemailClaim that holds the email address.
Name ClaimnameClaim that holds the display name. given_name and family_name are used instead when both are present.
Groups ClaimgroupsClaim that lists the user's groups, for team mapping. A dotted name reads nested claims, for example realm_access.roles for Keycloak realm roles.
Require Group [ Optional ]When set, login is refused unless this group appears in the groups claim. The comparison is exact and case sensitive.

Settings take effect on the next login. Saving the form discards the cached discovery document, so a changed issuer URL or CA certificate is picked up immediately.

Login page with the Log in with OpenID Connect button

Setting up OpenID Connect

  1. Register Ledger at your provider as a confidential OpenID Connect client, or as a public client if you will rely on PKCE alone. Give it the redirect URI https://ledger.example.com/oidc/callback and the post-logout redirect URI https://ledger.example.com/login/, using your Ledger host name. Note the issuer URL, client ID, and client secret the provider shows you.
  2. Expose the groups you want to map. Most providers need a mapper or a token configuration step before a groups claim appears in the ID token. See Provider examples.
  3. In Ledger, open Settings > Authentication > OpenID Connect. Turn on Enable OpenID Connect, enter the Issuer URL, Client ID, and Client Secret, confirm the Redirect URL matches what you registered, and change the claim names only if your provider uses different ones. Set Require Group if only members of one group may sign in. Click Save.
  4. Click Test. It runs discovery against the issuer URL and fetches the provider's signing keys, so a wrong URL, an untrusted certificate, or an unreachable provider shows up before any user tries to log in.
  5. Map groups to teams under Admin > Teams (see below). Then sign in from the login page with Log in with OpenID Connect and check the new account's teams under Admin > Users.

OpenID Connect endpoints

PurposeMethodPath
Start loginGET/login/oidc/
Callback (redirect URI)GET/oidc/callback

Both endpoints are public and do not require an existing session.

How OpenID Connect authentication works

  1. The user clicks Log in with OpenID Connect.
  2. Ledger runs (or reuses cached) discovery against the issuer URL and generates a random state, nonce, and, when PKCE is on, a code verifier, which it stores in the user's session.
  3. The browser is redirected to the provider's authorization endpoint, and the user authenticates there.
  4. The provider redirects the browser back to the Redirect URL with an authorization code. Ledger checks the state and exchanges the code for an ID token at the provider's token endpoint.
  5. Ledger validates the ID token (see below). If a mapped claim is missing from the token, or the token has an email without an email_verified claim, Ledger fetches the additional claims from the provider's UserInfo endpoint. Claims already in the token are never overridden.
  6. Ledger maps the claims, applies Require Group, creates or updates the OpenID Connect account, reconciles team membership, and starts the session.

A login must complete within 5 minutes of step 2. A callback that arrives later, or without a matching state, is rejected and logged.

What the ID token is validated against

CheckRequirement
Discovered endpointsEvery endpoint Ledger uses from the discovery document (authorization, token, JWKS, UserInfo, and end session) must use https://, with loopback http:// excepted.
SignatureMust verify against a key in the provider's JWKS.
Issueriss must equal the Issuer URL.
Audienceaud must contain the Client ID.
Expiryexp must be in the future, allowing for small clock skew.
NonceMust equal the value Ledger generated for this login.
StateThe callback state must equal the value stored for this login.
PKCEWhen enabled, the provider verifies the code verifier against the challenge, so a stolen authorization code cannot be exchanged elsewhere.

OpenID Connect claim mapping

ClaimMaps to
Username Claim (default preferred_username)Username
Email Claim (default email)Email
Name Claim (default name)Full name
given_nameGiven name
family_nameSurname
subSubject, the stable identifier of the user at the provider
Groups Claim (default groups)Groups, multi-valued

When no email claim is present but the username or subject looks like an email address (for example, Microsoft Entra ID sends the UPN as preferred_username), it is used as the email. A new account's username is the username claim, or the local part of the email when there is no username claim. The display name (given name and family name, then the name claim, then the given name, then the username) and the email are refreshed from the provider at each login. When no name is supplied, a new account is named New User.

For how an ID token is matched to an existing account, see Federated account matching.

OpenID Connect group to team mapping

Under Admin > Teams, each team has an optional OIDC Group Name field, shown when OpenID Connect is enabled. On each OpenID Connect login, for every team with an OIDC Group Name, the user is added if the groups claim contains that value and removed if it does not. Teams without an OIDC Group Name are left untouched. The team's Users tab lists these accounts under OIDC Users.

Team details with the OIDC Group Name field

OpenID Connect logout

When an OpenID Connect user logs out, Ledger clears the local session immediately. If the provider advertises an end-session endpoint, or a Logout URL is configured, Ledger then redirects the browser there so the provider can end its session, and asks the provider to return the user to Ledger's login page. If neither exists, logout only clears the Ledger session.

Register https://ledger.example.com/login/ (with your Ledger host name) as an allowed post-logout redirect URI at the provider, so users return to Ledger after logging out.

Testing the OpenID Connect configuration

The Test button checks the saved configuration: the required fields are present and well formed, the Redirect URL ends in /oidc/callback, discovery against the issuer URL succeeds (using the CA certificate if set), and the provider's JWKS is reachable and contains at least one key. It does not perform a browser round trip, so confirm sign-in from the login page. Save before testing.

Provider examples

Ledger settingKeycloakMicrosoft Entra IDOktaGoogle Workspace
Issuer URLhttps://kc.example.com/realms/<realm>https://login.microsoftonline.com/<tenant-id>/v2.0https://<org>.okta.com, or a custom authorization server such as https://<org>.okta.com/oauth2/<id>https://accounts.google.com
Scopesopenid profile email, plus a groups mapperopenid profile email; groups come from the token configurationopenid profile email groupsopenid profile email
Username Claimpreferred_usernamepreferred_username (the UPN)preferred_usernameemail
Groups Claimgroups (add a Group Membership mapper with Full group path off), or realm_access.roles for realm rolesgroups (in the app registration, add a groups claim under Token configuration)groups (add a groups claim filter to the app)None; Google sends no groups claim, so leave team mapping unused
Redirect URI to registerhttps://ledger.example.com/oidc/callbackSameSameSame

OpenID Connect troubleshooting

Turn on debug logging to log discovery, every claim in the ID token, and each mapping decision.

  • OpenID Connect discovery failed (Test): the Issuer URL is wrong, cannot be reached from the Ledger web service, or presents a certificate from a private CA (paste that CA into Server CA Certificate). Check that the issuer's /.well-known/openid-configuration returns JSON and that its issuer field equals the Issuer URL exactly.
  • oidc: id token issued by a different provider: the iss in the token differs from the Issuer URL, often because of a trailing slash or a tenant-specific versus common Entra ID endpoint. Copy the issuer value from the discovery document.
  • oidc: expected audience: the Client ID does not match the application the token was issued for.
  • callback state does not match the session: the browser did not present the session that started the login. The session cookie was not stored (a third-party cookie or private mode setting), the login took longer than 5 minutes, or a second login was started in another tab. Retry from the login page.
  • token response did not include an id_token: the client is not allowed the openid scope, or is configured as a plain OAuth 2.0 client at the provider.
  • authorization code exchange failed: the Client Secret is wrong, the redirect URI registered at the provider does not exactly match the Redirect URL, or the provider does not support PKCE (turn off Use PKCE).
  • User created but no teams: the groups claim is not in the ID token or UserInfo response. Check the debug log for the claim names actually received and adjust Groups Claim. Keycloak needs a mapper, and Entra ID needs the groups token configuration.
  • not a member of the required group: Require Group is set and the groups claim does not include it. The comparison is exact and case sensitive.
  • refusing to sign in as ... the matching account is a local account: the username or email in the ID token belongs to an existing local, LDAP, or SAML account. See Federated account matching.
  • the account is bound to a different OIDC principal: the username or verified email now belongs to a different subject at the provider than the one that created the account. Either the identifier was reassigned at the provider, or the account should be deleted so the new subject can create its own.
  • not matching by email ... the IdP did not mark it verified (debug log): the ID token has no email_verified: true claim, so matching falls back to the username claim. Ask the provider to include the verified email claim if you expect email-based matching.
  • returned an unacceptable endpoint: the discovery document advertises an endpoint that does not use https://, or is missing one. Ledger refuses to send credentials or tokens to such an endpoint; fix the provider's configuration.
  • must use https (Test): the Issuer URL or Logout URL uses plain http:// to a host other than loopback. Use the provider's https:// URL.

Federated account matching

SAML and OpenID Connect accounts are each bound to the identity provider principal that created them:

  • OpenID Connect: the issuer URL and the ID token's sub claim.
  • SAML: the IdP entity ID and the assertion's NameID, unless the NameID format is transient. With a transient NameID, no binding is stored and matching falls back to the username and email at every login.

At each login, Ledger resolves the account in this order:

  1. By principal: an account of the same type already bound to this principal. This is the normal path after the first login, and it keeps working if the user's username or email changes at the IdP.
  2. By username, then by email: only for an account of the same type that is not yet bound. Email is used only when the IdP vouches for it: OpenID Connect requires email_verified to be true (an absent claim counts as unverified), while attributes in a signed SAML assertion are treated as verified. The matched account is then bound to the principal.
  3. Create a new account of the provider's type, bound to the principal.

A username or email match is refused, and the refusal logged, when the account is of a different type (local, LDAP, or the other federated protocol), is already bound to a different principal, or is bound while this login carries no principal (a SAML transient NameID). Switching a SAML IdP from a persistent to a transient NameID format therefore locks out users who were already bound until they are deleted and created again at their next login.

These rules stop an identity provider from signing in as an account it did not create. Without them, a provider-side username of admin could sign in as the local administrator, and a reassigned or unverified email could take over another user's account.

What this means for administrators:

  • Creating a local account in advance for a user who will sign in with SAML or OpenID Connect does not link the two. Let the first federated login create the account, then assign its teams and permissions.
  • If your OpenID Connect provider does not send email_verified: true, users are matched by the username claim (or the bound principal) only. Make sure the username claim is stable and unique, or enable verified email claims at the provider.
  • A new federated account is never created when its username is already taken by another account of any type. The login is refused with refusing to provision ... the username already belongs to another account. Rename or delete the other account, or change the username the IdP sends.
  • LDAP is not affected: LDAP logins use the login form and only match LDAP accounts.

Debug logging

All sign-in integrations write step-by-step diagnostics when debug logging is on. This is the fastest way to see exactly what the directory or IdP returned: LDAP debug logging prints every attribute returned for a user and the result of each group membership check, SAML debug logging prints the assertion's NameID and every attribute (and the raw response if validation fails), and OpenID Connect debug logging prints every claim in the verified ID token.

To turn it on, set the DEBUG environment variable to true on the Ledger web service and restart it. Debug lines start with DEBUG: in the web service log. On a Kubernetes installation made with the Ascender Pro installer, the web deployment is named web in the Ledger namespace (ledger by default):

kubectl -n ledger set env deployment/web DEBUG=true kubectl -n ledger logs -f deployment/web
Warning

Debug logging is verbose and can include user attributes, SAML assertion attributes and raw SAML responses, and ID token claims. Turn it on only while troubleshooting, then set DEBUG=false again. Re-running the installer also resets the deployment.