Sign-in and roles

People sign in to the web UI through your identity provider, with OIDC, SAML or LDAP, and SCIM ends their access as soon as they leave. Everyone who signs in is a viewer or an admin.

Sign-in controls the web UI. Package managers and CI use access tokens instead, which people create after they sign in. See tokens.

Every sign-in method ends in the same checks. The person's email must be allowed, and SCIM must not have switched them off. A web session lasts up to 12 hours.

OIDC

Create an OIDC application at your identity provider, with this redirect URL:

textredirect URL
https://pratique.example.com/auth/callback

Then set:

bashOIDC settings
PRATIQUE_OIDC_ISSUER=https://idp.example.com
PRATIQUE_OIDC_CLIENT_ID=...
PRATIQUE_OIDC_CLIENT_SECRET=...
PRATIQUE_OIDC_ALLOWED=@example.com,contractor@partner.com   # required
PRATIQUE_ADMINS=alice@example.com,bob@example.com

In the config file, these are issuer, client_id, client_secret, allowed and admins under sso:. The sign-in page then shows Sign in with single sign-on.

  • The allowed list is required. It holds emails, or domains written as @example.com. An OIDC provider can be a public one, so without the list anyone with an account there could sign in. Pratique refuses to start with an issuer and no allowed list.
  • Everyone on the allowed list signs in as a viewer. People in PRATIQUE_ADMINS are admins.
  • Changes to either list apply after a restart, on the next request, even to open sessions.
  • Pratique requires a verified email. Some providers, such as Microsoft Entra ID, omit the email_verified claim. For those, set PRATIQUE_OIDC_TRUST_EMAIL=true (trust_email: true), once you have confirmed that the provider controls that field.

Pratique contacts the identity provider when someone signs in, not at startup, so an identity provider outage can't stop package traffic.

SAML

SAML, LDAP and SCIM go beside OIDC under sso: in the config file. For SAML and LDAP the allowed list is optional: without one, everyone the directory knows can sign in, because a company's own directory only knows its own people.

SAML needs an https:// PRATIQUE_PUBLIC_URL. Each sign-in works only in the browser that started it, which a short-lived cookie checks. The provider posts its answer from its own site, so that cookie must be SameSite=None; Secure, and browsers send it only over HTTPS. Over plain HTTP, SAML sign-in fails.

The People page shows the addresses your identity provider asks for: the SAML sign-on address (ACS), which is /auth/saml/acs, and the SAML metadata and entity ID. Give them to your provider, then point Pratique at the provider's metadata, as a URL or a file:

yamlpratique.yaml
sso:
  saml:
    metadata: https://idp.example.com/metadata.xml

The environment variable is PRATIQUE_SAML_METADATA. To use a different entity ID, set entity_id or PRATIQUE_SAML_ENTITY_ID.

  • The email comes from the usual attributes, then from the name ID.
  • A sign-in must start at Pratique. Pratique doesn't accept a login started at the provider, because that would let a stolen response be replayed. Each response works once.
  • Pratique doesn't sign its requests or accept encrypted assertions. Turn those requirements off in your provider.
  • The metadata is reloaded daily, so a rotated signing certificate is picked up. If a reload fails, Pratique keeps the last good copy.

LDAP

With LDAP, people type their directory username or email and password on the sign-in page, and choose Sign in with your directory.

yamlpratique.yaml
sso:
  ldap:
    url: ldaps://ldap.example.com
    bind_dn: cn=pratique,ou=services,dc=example,dc=com
    bind_password: ${LDAP_PASSWORD}
    user_base: ou=people,dc=example,dc=com

Pratique finds the person with the service account, then checks the password by binding as them.

  • The connection is always encrypted off this machine. ldaps:// uses TLS. An ldap:// address uses StartTLS, unless the server is on the same machine, so a password can't cross the network in the clear.
  • ca is a file with a private certificate authority to trust.
  • user_filter finds the person. The default is (|(mail={login})(uid={login})), and a filter must contain {login}.
  • email_attr is the attribute that holds the email. The default is mail.
  • user_base is required with an LDAP URL.

Failed LDAP attempts count toward the same sign-in limit as other attempts. The environment variables are PRATIQUE_LDAP_URL, PRATIQUE_LDAP_BIND_DN, PRATIQUE_LDAP_BIND_PASSWORD, PRATIQUE_LDAP_USER_BASE, PRATIQUE_LDAP_USER_FILTER, PRATIQUE_LDAP_EMAIL_ATTR and PRATIQUE_LDAP_CA.

SCIM

Without SCIM, Pratique only learns who someone is when they sign in. With SCIM, your identity provider tells Pratique who works there, and who has left. Point your provider at the SCIM base address shown on the People page, with the token as a bearer token:

yamlpratique.yaml
sso:
  scim:
    token: ${SCIM_TOKEN}   # at least 32 characters
    required: true         # only people it has provisioned can sign in

The environment variables are PRATIQUE_SCIM_TOKEN and PRATIQUE_SCIM_REQUIRED. A token shorter than 32 characters stops the server from starting, and so does required without a token.

When your provider switches someone off or deletes them, their sessions and personal tokens stop working straight away, whichever way they signed in.

  • Their personal tokens are revoked.
  • Bot tokens they created keep working, because revoking them could stop a production build. The audit log says how many remain, so an admin can review them under Access tokens.
  • Deleting someone can't be undone by signing in again. They show as Access ended on the People page.

The People page lists everyone SCIM has sent, with their status, groups and tokens. Without SCIM it stays empty.

Admins from groups

List the groups whose members are admins:

yamlpratique.yaml
sso:
  admin_groups: [pratique-admins]

The environment variable is PRATIQUE_ADMIN_GROUPS. Groups can come from these sources:

SourceWhere the groups come fromHow fresh
SCIMGroups your provider sendsA change applies at once.
OIDCA groups claim in the ID tokenRead at sign-in. Lasts until the session ends, up to 12 hours.
SAMLAn attribute such as groupsRead at sign-in. Lasts until the session ends, up to 12 hours.
LDAPmemberOf, by full name or CNRead at sign-in. Lasts until the session ends, up to 12 hours.

Without SCIM, taking someone out of a group only takes effect at their next sign-in. To end an admin's access urgently without SCIM, when you use an allowed list, remove them from it and restart. That ends their web access on their next request. With SCIM, switching someone off ends their session at once.

The admin token

PRATIQUE_ADMIN_TOKEN signs in as an admin without the identity provider. When single sign-on is configured, the sign-in page shows it under Use the admin token. Scripts can also send it on each request, as a bearer token or a Basic password.

  • As a break-glass login, keep it set and stored safely, so you can still sign in during an identity provider outage.
  • For single sign-on only, leave it unset. Then no admin token exists that can leak.
  • With no admin token and no single sign-on, Pratique generates one for each run and prints it to standard error.

Sign-in throttling

After 10 failed attempts from one address within a minute, Pratique refuses further attempts from that address with "Too many failed attempts. Wait a minute and try again." Wrong admin tokens sent by scripts count toward the same limit.

The limit is kept in memory on each instance, so with several replicas it multiplies by their number. Behind a proxy, set PRATIQUE_TRUST_PROXY, or every client shares the proxy's address. See install.

Roles

Everyone who signs in is a viewer or an admin.

ActionViewerAdmin
See packages, activity, incidents and settingsYesYes
Create and revoke their own read tokensYesYes
Request an exceptionYesYes
Approve requests and set exceptionsNoYes
Change quarantine settings and resolve incidentsNoYes
Create bot, AI triage and publish tokens, and revoke anyone's tokensNoYes

Someone who is no longer an admin loses publish access on their personal tokens the next time they sign in. Bot tokens keep theirs.

When someone leaves

Removing someone from the allowed list ends their web access, but doesn't revoke their access tokens. Revoke those under Access tokens. With SCIM, switching someone off revokes their personal tokens and ends their sessions at once, so you don't have to remember. See SCIM.