Quilzomanual

Single sign-on with OIDC and SAML

Sign in through the identity provider you already run.

In the adminSingle sign-on

The Single sign-on screen: a Keycloak provider for northwind.example whose Addresses row reads only those it says are verified, in email_verified, and below it the Rules of the Add one form with the box Take addresses as the provider sends them, verified or not
A Keycloak provider, and the Rules at the foot of Add one.

OpenID Connect

quilzo oidc configure --provider google --domain example.com
quilzo oidc configure --provider microsoft --tenant TENANT
quilzo oidc configure --issuer https://idp.example.com --client-id ID
quilzo oidc check

A sign-in finishes only in the browser that started it: starting one sets a cookie the provider's answer must come back with, so a sign-in somebody else began cannot be completed in your browser to put you in their account.

SAML

quilzo saml presets
quilzo saml add okta --metadata metadata.xml --url https://quilzo.example.com --preset okta
quilzo saml add okta ... --fingerprint SHA256   # trust its key, once you have checked it

Presets: Okta, Microsoft Entra, Google, JumpCloud, OneLogin, PingOne, AD FS and Keycloak. Single sign-on can be required, with named break-glass accounts that keep working when the provider does not. A requirement holds on every request, not only at the sign-in form: a session that did not come through the provider is refused, whichever way it was made.

Only addresses the provider verified

SAML has no word of its own for an address the provider has checked. Name the attribute the provider says it in, and a sign-in as an address it does not say true about is refused:

ToRun
Refuse an address the provider has not verifiedquilzo saml add NAME --metadata F --url U --preset keycloak --verified-attribute email_verified
Take addresses as the provider sends them, verified or notquilzo saml add NAME ... --allow-unverified-email
  • Give one or the other. With neither, a provider that sends email_verified saying anything but true is still believed, and the sign-in is refused; one that says nothing is taken as sent.
  • Only an address is asked about. A provider that signs people in by a username (--principal attribute:uid) or an opaque NameID is not.
  • A Keycloak user can change their own address and leave it unverified, so the Keycloak preset asks for email_verified by itself. Keycloak sends it only when a mapper does: in the client, add a User Property mapper, property emailVerified, SAML attribute name email_verified. quilzo saml presets says where.
  • On the screen, each provider's card says under Addresses which it takes, and Add one › Rules has Take addresses as the provider sends them, verified or not.

A provider added before its preset asked for the attribute goes on taking addresses as sent, because asking for it unannounced would refuse everybody until the provider sends it. The security posture names it (sso.unverified-addresses). Once the provider sends the attribute, add it again: quilzo saml add NAME ... --replace --verified-attribute email_verified.

An identity provider on your own network

An OIDC issuer and a SAML metadata address are fetched by this server, so they are held to the rule for every address somebody chose: public, never this machine or the network it is on. An identity provider on the organisation's own network, such as Keycloak, AD FS or Authentik, is reached only where sso.reach names its range:

quilzo config set sso.reach 10.20.0.0/16 --accept-risk "Keycloak runs on the internal network"
  • Name the smallest range that holds it, or its one address. Only private ranges and this machine can be named: never link-local, where cloud metadata lives, and never a public range.
  • It opens sign-in's own connections, its discovery, keys, token exchange and SAML metadata, and nothing else.
  • It is a weaker setting, so it takes a reason, which is recorded, and a second administrator approves it. quilzo posture scan reports it until it is changed back or renewed.
  • An address refused by oidc configure, saml add or the metadata address on the Single sign-on screen says how to reach it.

When a sign-in counts as two factors

A single sign-on counts as two factors only when the identity provider says so, about a sign-in no older than session.max. Anything else is one factor: the session waits at Confirm it's you for the person's passkey. Somebody without a passkey here is given a link that adds one.

ProviderCounts as two factors whenTo set up
Microsoft Entra ID, OIDCthe ID token's amr names mfaIn the app registration, Token configuration › Add optional claim › ID: add amr and auth_time
Google, OIDCGoogle's amr names mfa, which it says for verified appsNothing; otherwise people confirm with a passkey here
Okta, Auth0 and others, OIDCamr names mfa, or acr is a value you namequilzo oidc configure ... --mfa-acr urn:okta:loa:2fa:any, if you want it asked for
Keycloak, OIDCacr is a level you name, or amr names mfaMap levels to acr, or add the AMR mapper, and name the level: --mfa-acr 2
Okta, SAMLthe attribute amr holds mfaIn the app's attribute statements, add amr with the value session.amr
JumpCloud, OneLogin, PingOne, Keycloak, SAMLthe assertion's context is https://refeds.org/profile/mfaHave the provider send that context for this app when it used a second factor
Microsoft Entra ID, AD FS, SAMLthe authnmethodsreferences attribute holds multipleauthnEntra: add the optional claim amr with the property include_granular_amr
Google Workspace, SAMLnever: Google does not sayNothing; every sign-in is confirmed with a passkey here

A SAML sign-in asks the provider for nothing: one that cannot meet a requested context refuses the sign-in. An OIDC sign-in asks for one no older than session.max (max_age), and for amr and auth_time by name where the provider reads the claims parameter. quilzo oidc check says whether it does, and quilzo oidc status what your provider needs.

Signing out, and refusals

Signing out ends the session here. The session at the identity provider is its own and goes on, so signing in through it again may not ask for a password, and the sign-in page says so afterwards. For an OIDC sign-in whose provider has a sign-out address, it offers to sign out there too, and the Sign out? page (see how long a sign-in lasts) offers Sign out here and at PROVIDER beside Sign out. A SAML sign-in is offered neither: Quilzo sends no SAML sign-out, so sign out at the provider.

A refusal says why:

  • Plain http is refused in the words of what the connection is for: an identity provider's metadata and keys decide who signs in, and over plain http anyone on the path chooses them.
  • A SAML response that was refused is said once, naming the provider: The response from Keycloak was refused, and the reason.
  • quilzo oidc status says whether QUILZO_OIDC_SECRET is set in this shell. quilzo serve reads it from its own environment and does not start without it, so set it where the server starts.

When the identity provider ends a session

A session made by single sign-on is Quilzo's own: the provider vouches once, and the hours after that are local. So when the provider ends somebody's session, sees their password stolen or disables their account, nothing reaches the session already open here unless the provider says so. Its security event stream (OpenID Shared Signals: CAEP and RISC) is how it says so, and Quilzo receives it at POST /sso/signals on the admin.

ToRun
Give the stream client's secret, which is never storedexport QUILZO_SIGNALS_SECRET=...
Connect a provider that publishes a stream APIquilzo signals connect --provider oidc --client-id quilzo-stream
Connect a stream made in the provider's own consolequilzo signals connect --provider oidc --jwks URL
Connect one for a SAML providerquilzo signals connect --provider saml:NAME --issuer URL ...
See whether it worksquilzo signals status, or Sign-ins
Turn it offquilzo signals off
  • The stream is bound to one way of signing in, oidc or saml:NAME, and its events reach only the sessions that provider signed in, unless it disables an account outright.
  • The provider pushes to /sso/signals at the origin of the OIDC redirect URI, or at the SAML provider's --url. That address has to be https and one the provider can reach.
  • With --client-id, Quilzo asks the provider for the stream through its API, gives it a push secret it never shows, and asks it to verify. With --jwks, for a stream made in the provider's console, it prints the push address, the audience, the authorization and the events to ask for. The authorization is shown once and kept only as a digest.
  • --issuer is the OIDC issuer unless given, and is required for saml:NAME.
  • quilzo signals off refuses anything pushed after it and asks the provider to delete the stream, or says to delete it in the provider's console. The denies it added stay until the account is enabled or a person lifts them.
The provider saysQuilzo does
session-revoked, sessions-revoked; credential-change (update, revoke, delete)Ends that provider's sessions for them opened before the event was issued
credential-compromise, account-credential-change-requiredThe same; every other session they had open then must confirm it is them; the security contact is told
account-disabled, account-purgedSuspends them as SCIM does: every token, every app they connected, and a deny over the whole site that passkeys and single sign-on refuse
account-enabledLifts the deny it added, and no other

What keeps the stream from being turned against the site:

  • Every event is a token signed by the provider's published key, for this receiver, and pushed with a bearer only the provider was given. Who it is about has to be somebody the access policy already knows; anything else is counted as unmatched and nothing is done.
  • The last person who can grant access is never suspended this way: their sessions end and the security contact is told.
  • At most twenty people an hour are acted on. An event about anybody else is answered 503 with a Retry-After of when the hour is up, and is acted on when the provider sends it again.
  • An account-enabled or account-disabled older than what was last done about that person, or a copy of one already acted on, is refused and recorded as signals.stale, so a replay cannot lift a newer suspension or suspend again somebody the provider has enabled since.
  • Once a day the server asks the provider to verify the stream, with QUILZO_SIGNALS_SECRET from its own environment: set it wherever quilzo serve starts. The posture finding signals.stream-silent reports a stream that has not answered for a day, and one made in the console, which cannot be asked.
  • The shield's signals feature turns the endpoint off. It answers 503 with a time to come back, so a provider that retries sends the event again later.

One administrator connects it, with the authority to grant access: there is no rule to write, and every event only takes access away. Each act is in the audit log as signals.sessions-ended, signals.step-up, signals.suspended, signals.restored and the like.