Configuration Lives In The Database, Not In Files

A SAML provider is a row in sso_providers with provider = 'saml', created and edited in Studio → Admin Console → SSO. There is nothing to set in .env and nothing to restart: a complete, enabled row makes the sign-in button appear, and disabling the row removes it immediately.

The feature has no flag. SAML switches on by configuration existing. SamlConfig.missing() refuses a half-configured row on the request path, so a provider that is not usable simply never appears — a flag would be a second switch that could disagree with the first.
One enabled SAML row per tenant. Provider lookup takes the first enabled row matching the tenant, in no defined order, so a second row on the same tenant is unreachable. Give each identity provider its own tenant — the ACS URL names it.

The Fastest Route: Import The Metadata

Every identity provider publishes a federation metadata document, and it contains the three values that are otherwise the fiddliest to copy: the issuer, the sign-in URL and the signing certificate. Paste its URL into Import from IdP metadata on the SSO form and press Import.

1. Create the application at your identity provider (see the two walkthroughs below). This step cannot be automated — SAML has no registration protocol, so the app has to exist before anything can read it.

2. Copy its metadata URL.

3. Paste, Import, review the filled fields, then save.

Import fills the form; it saves nothing until you press save. That is deliberate: an import that wrote straight through would let a single fetch repoint a live sign-in.

Why this exists. The three values have three different names in every product. Okta's Identity Provider Issuer, Entra's Microsoft Entra Identifier and the IdP Entity ID field in Velaris are the same thing. The metadata document is the one place all three agree, which is why importing is shorter and safer than transcribing.

If this deployment cannot reach the internet, expand Paste the XML instead and paste the document itself. Nothing is fetched — and because no URL is stored, there is no automatic certificate renewal for that provider.

What Velaris Needs From The IdP

Velaris fieldOkta calls itEntra calls itRequired
IdP Entity IDIdentity Provider IssuerMicrosoft Entra IdentifierYes
IdP SSO URLIdentity Provider Single Sign-On URLLogin URLYes
IdP signing certificateX.509 CertificateCertificate (Base64)Yes — one or more
IdP single logout URLSign-Out URLLogout URLNo

The certificate field accepts either a bare base64 body or a full -----BEGIN CERTIFICATE----- block, whichever the console gives you.

What The IdP Needs From Velaris

The SSO form prints these for the provider you are editing, with the tenant already filled in. Substitute your own host and tenant.

ValueOkta / Entra field
https://your-host/api/v1/auth/saml/<tenant>/acsSingle sign-on URL (Okta) / Reply URL (Entra)
velaris-studio — or whatever you set as SP Entity IDAudience URI (Okta) / Identifier (Entra)
https://your-host/api/v1/auth/saml/<tenant>/metadataSP metadata, if the IdP prefers to import
https://your-host/api/v1/auth/saml/<tenant>/sloSingle sign-out URL — only when single logout is switched on
The SP signing / encryption certificateOnly once you have generated an SP key pair — see below
The <tenant> segment in the ACS URL is load-bearing. Destination and Recipient are compared against the configured ACS URL, and the route's tenant segment must match it. That is what stops a valid assertion being replayed into another tenant. It is also where the sign-in button's link comes from, so an ACS URL of any other shape means no button appears. The form refuses to save one that does not end /auth/saml/<tenant>/acs.

Okta — Walkthrough

1. Okta Admin → Applications → Create App Integration → SAML 2.0.

2. Single sign-on URL: the ACS URL above. Audience URI: your SP Entity ID.

3. Name ID format: EmailAddress. Application username: Email.

4. Attribute statements: email, firstName, lastName. Group attribute statement: name it groups, filter Matches regex .*.

5. Assign the app to your users. Okta refuses to issue an assertion for anyone who is not assigned — before Velaris is involved at all.

6. On the app's Sign On tab, open View SAML setup instructions for the issuer, SSO URL and certificate, or copy the metadata URL and import it.

localhost works as a reply URL for a local trial: the assertion travels through the browser, not from Okta's cloud to your machine.

Microsoft Entra ID — Walkthrough

1. Entra admin centre → Enterprise applications → New application → Create your own application → “Integrate any other application you don't find in the gallery”.

2. Single sign-on → SAML. In Basic SAML Configuration set Identifier to your SP Entity ID and Reply URL to the ACS URL. Leave Sign on URL blank.

3. Optional: Attributes & Claims → Add a group claim → Security groups, source attribute Group ID.

4. Users and groups → Add user — assign people individually. Group-based assignment is an Entra ID P1 feature; per-user assignment is not.

5. Copy the App Federation Metadata Url from the SAML Certificates panel and import it.

SAML SSO for a custom application works on Entra ID Free. Automatic user provisioning over SCIM does not — that requires Entra ID P1. Velaris supports SCIM from any IdP that can send it; the licence is Microsoft's constraint, not ours.
Entra group claims arrive as directory GUIDs, not names. Map each GUID to an access group under Admin Console → Identity. An unmapped group grants nothing and is listed there for you to map.

Who Gets An Account

SettingEffect
Allowed email domainsA user who authenticates but has no Velaris account is created only if their email domain is listed. Empty means auto-provisioning is off — existing accounts only.
Create an account on first sign-inThe same switch, stated separately, so a deliberate “existing accounts only” survives someone adding a domain.
Default rolesApplied only to accounts created by auto-provisioning. Existing users keep the roles they have. superadmin is refused.
Adopt an existing account by emailLeave off. See below.
Allowed landing pathsWhere a completed sign-in may land. The first is used when the IdP sends no RelayState. Must be a path on this server.
Why account adoption by email is off by default. With it on, whoever can set an email attribute in the directory signs in as whichever Velaris account already holds that address, inheriting its roles — and the domain allowlist is no defence, because the corporate domain is exactly the one it allows. Off, an unrecognised identity provisions a new account and a taken address is refused, for an administrator to link deliberately under Admin Console → Identity → Linked accounts. An account with a local password is never adopted, even with the setting on.
Password reset is closed to SSO accounts. An account with no local password is issued no reset code, so a federated user cannot mint a credential that would outlive their IdP account. The response and the next screen are identical for every address, so the flow never reveals which accounts exist or which are SSO-only.

Certificates Look After Themselves

When a metadata URL is stored, Velaris re-reads it every six hours and adds any new signing certificate it finds. Both certificates verify while they overlap, so an IdP's routine key rollover costs no downtime and needs no intervention.

SituationWhat happens
New certificate publishedAdded. The old one stays until you remove it by hand.
Certificate disappears from metadataNothing. Refreshes never remove — a truncated response must not be able to strip the key that currently works.
Issuer or sign-in URL changedNot applied. Flagged on the provider card for review.
Metadata unreachableNothing changes — same certificates, same URLs, still enabled. The error is noted on the card.
Certificate nearing expiryThe card shows the expiry date at all times, and warns inside 30 days.
A changed issuer or sign-in URL is never applied automatically. Repointing where users are sent to authenticate, or which issuer is trusted to vouch for them, on the strength of one fetch would be a takeover primitive. Import it yourself once you have reviewed the change.

The metadata URL must be https and is checked against the outbound guard on write and again before every fetch, so it cannot be used to reach internal infrastructure.

The SP Key Pair — And What It Unlocks

Out of the box, Velaris is a passive service provider: it checks the identity provider's signature and holds no key of its own. That is enough for ordinary sign-in. Three things a security review usually asks for are not possible without one, and all three become available the moment you generate it.

FeatureWhat it gives you
Signed sign-in requestsThe IdP can verify that a sign-in request really came from Velaris. Some deployments — ADFS in particular — require it.
Encrypted assertionsThe IdP seals the assertion to your public key, so the contents are unreadable to anything in between, including the browser that carries it.
Single sign-outSigning out of the IdP ends the Velaris session too, and the other way round.

1. Open the provider under Admin Console → SSO and press Generate SP key. Velaris creates an RSA key and a self-signed certificate valid for three years. The certificate is shown; the private half never leaves the server and is never returned by any endpoint.

2. Re-import the SP metadata (/api/v1/auth/saml/<tenant>/metadata) at your identity provider, or upload the certificate by hand. It is published for both signing and encryption.

3. Only now turn on Sign sign-in requests, or switch on encryption at the IdP.

Order matters. Turning on request signing before the IdP holds the certificate breaks every sign-in — the IdP rejects the request with an error the user cannot read. That is why both switches are off until you set them, and why replacing the key tells you to re-import.
The certificate is public; the key is not. The private half is sealed with the tenant's own encryption key and stored separately from the provider's settings, so it never appears in the admin console's data. There is no automatic rotation: replacing the pair means re-importing metadata at the IdP, so a scheduled rotation would be an outage with a timer on it. The card shows the age, fingerprint and expiry so you can plan one.
Encryption is not proof of origin. Your certificate is published, so anyone can seal an assertion to it. Velaris accepts an encrypted assertion only when it is also signed — either the response signature covers the sealed content, or the assertion is signed inside. An encrypted assertion nobody signed is refused, exactly like an unsigned one.

On the algorithms: RSA-OAEP key transport and AES-CBC or AES-GCM content encryption are supported, which covers the Okta and Entra defaults. The obsolete RSA-1.5 key transport is refused rather than supported — it is what the classic attacks on encrypted XML target. Every decryption failure answers identically, for the same reason every sign-in failure does.

Single Sign-Out

Switch on Single logout and fill in the IdP's sign-out URL, and sessions end in both directions.

DirectionWhat happens
User signs out of the identity providerThe IdP calls Velaris, which ends every session and device for that person, then redirects back with a receipt.
User signs out of VelarisVelaris ends the local session first, then hands the browser to the IdP to end its own. If the IdP is unreachable, or the user closes the tab, they are still signed out here.

Velaris's own sign-out address is derived from the ACS URL — the same URL with /acs replaced by /slo — and is published in the SP metadata, so there is nothing extra to configure. It appears only when single logout is switched on.

A sign-out request is honoured only if the IdP signed it. The request names a user, and the endpoint is public: without a signature check, anyone could send one per second and keep a chosen person permanently signed out. An unsigned or wrongly-signed request revokes nothing. It also answers exactly like a valid one, and a request naming somebody who does not exist here answers like one naming somebody who does — otherwise the endpoint would tell an anonymous caller which people have accounts.
Signing out never disables an account. It ends sessions. Whether somebody keeps their access is a provisioning decision, made by your directory or an administrator — not by a sign-out message.

Sign-In Requests Are Tracked

When a user starts at the Velaris sign-in page, Velaris remembers the request it sent, and the assertion that comes back must answer that request. One minted for a different sign-in attempt cannot be posted into this one, and each request can be answered exactly once.

Starting at the IdP still works. An Okta or Entra application tile begins the flow at the identity provider, so there is no request to answer — that is normal and is accepted. The check applies to assertions that claim to answer a request: those must name one Velaris actually sent, and it must still be within its short window.

Testing And Diagnosis

ToolWhereWhat it tells you
Assertion testerAdmin Console → IdentityPaste a captured SAMLResponse: it runs the real verifier and reports the mapped attributes and the decision the live path would reach. Issues nothing, provisions nobody, and can be repeated while you fix an attribute map.
Provisioning logAdmin Console → IdentityEvery decision including refusals, with the reason.
Unmapped groupsAdmin Console → IdentityGroups the IdP asserted that map to nothing.
SP metadata/api/v1/auth/saml/<tenant>/metadataPublic. Hand it to the IdP administrator instead of dictating values.
Sign-in refusals are deliberately uniform. Every unusable state — unknown tenant, no provider, disabled row, half-configured row, tenant mismatch — answers the same 404, and every assertion failure the same 400. Telling a forger which check failed lets them fix one thing at a time. The reason goes to the provisioning log and the security event trail, which is where you should look.

Privileges

ActionPrivilege
View providers, import metadataidentity.sso.read — importing writes nothing, so it does not need the configure privilege
Create, edit or delete a provideridentity.sso.configure
Generate or replace the SP key pairidentity.sso.configure — it writes key material, and replacing it invalidates the old one
Link an account to an IdP identity, manage group mappingsidentity.provisioning.write

These are privileges, not roles. Grant them to any role — a developer, for instance — under Access Group Admin → Platform Roles, without a code change or a restart.