Single sign-on

Let an organization's people sign in with its own OIDC or SAML identity provider, prove the domains with DNS, map groups to roles and decide what Require SSO means.

Single sign-on (SSO) lets people sign in to an organization with the account their company already manages, such as Okta, Microsoft Entra ID, Google Workspace or Keycloak. Each organization sets up its own provider, proves the email domains it owns, and says what role people get. Wardn then checks every sign-in against those rules.

Read Sign-up modes first: SSO is one of the ways a person arrives, and the same server rules apply to it. To also create and remove people from the provider, continue with SCIM provisioning.

Open Settings › Single sign-on. Only an Owner can see and change it: every action here needs the sso:manage permission, which Owners hold and Admins and agents do not.

How it fits together

PieceWhat it does
Identity providerYour OIDC or SAML 2.0 provider. It proves who the person is.
DomainAn email domain, such as acme.example, that your organization proved it owns with a DNS record.
RolesThe role a person gets in your organization, from their groups.
Sign-in rulesRequire SSO for verified domains, and Create accounts on first sign-in.

The domain is what makes this safe. A provider can only sign in addresses on a domain its organization verified, so a provider you add cannot claim [email protected], and nobody else's provider can claim yours.

Set it up

Add the provider

Choose Add provider. Pick the protocol, give the provider a Name people will recognise, and fill in its details.

ProtocolFields
OIDCIssuer URL, Client ID, Client secret
SAML 2.0Sign-on URL, Entity ID, Signing certificate

Create the application in your provider first, and give it Wardn's addresses:

ProtocolGive your provider
OIDCThe redirect URI <public url>/api/auth/sso/callback/<provider id>
SAMLThe assertion consumer URL <public url>/api/auth/sso/saml2/sp/acs/<provider id>

<public url> is the address people open, the publicUrl of the chart. The client secret is sealed and never shown again.

Add and verify a domain

Under Domains, choose Add domain and enter a domain such as acme.example. Wardn shows a DNS record to publish:

_wardn-verify.acme.example   TXT   "wardn-site-verification=4f9c2a71d0"

Publish the record at your DNS host, wait for it to spread, and choose Check now. The status changes from pending to verified. If the record is not found, the row says what was found instead, so a typo in the value is easy to see. DNS can take a few minutes.

Then choose which Provider the domain sends people to. Leave it at No provider to verify a domain without sending anyone anywhere yet.

Set the roles

Under Roles, choose the Default role: what a person gets when none of their groups match a mapping. Then add a mapping for each group you want to give more.

Each mapping pairs a Group from your provider, written as the provider sends it, with a role in your organization: Admin, Contributor or Viewer. No group makes someone an Owner; Owners are made by hand in Members.

Test the sign-in

Choose Test sign-in at the top. It sends you to the provider and back. Do this while you are still signed in another way, so a mistake cannot lock you out. Then create a recovery code (below).

Domains

RuleWhat it means
One organization per domainA domain can be verified by one organization only. Adding one that another organization already holds is refused with sso.domain_taken, and nothing is said about who holds it.
TXT recordThe name is _wardn-verify.<domain> and the value is wardn-site-verification=<token>. Each added domain has its own token.
Exact matchA domain stands for addresses ending in @<domain>. Add each domain people use as its own row.
RemoveRemove on a row stops sending people on it to SSO, and Require SSO no longer applies to them. Their accounts stay.
Checked every dayWardn looks for the TXT record once a day. If it is missing three days in a row the claim ends: the row shows Record missing, the domain stops sending people to SSO, Require SSO stops applying to it, and the change is in Activity. Put the record back and choose Check now to verify it again. This keeps a domain that changed hands from sending its new owners' people to the organization that verified it before.
Deleted organizationsDeleting an organization frees every domain it verified. A claim left behind by an organization that no longer exists never blocks anyone from adding the domain.

Wardn also uses verified domains to answer Ask to join on the Welcome page: only organizations that verified a person's domain are offered to them.

Roles from groups

Your provider sends each person's groups with the sign-in. Wardn looks them up in your mappings:

  • The highest role among the person's groups wins. A person in engineering (Contributor) and platform-admins (Admin) gets Admin.
  • With no match, the person gets the Default role.
  • It runs at every sign-in, not only the first. Move someone to another group in your provider and their role in Wardn changes the next time they sign in. Remove their last group and they fall back to the default role.

Wardn reads the groups from the sign-in in this order and uses the first it finds: groups, memberOf, then the Microsoft and SAML group claims (http://schemas.microsoft.com/ws/2008/06/identity/claims/groups and http://schemas.xmlsoap.org/claims/Group). The value can be a list, or one comma-separated string. Wardn reads at most 500 groups per sign-in. A mapping's group name must match what the provider sends, ignoring case and surrounding spaces, and Microsoft Entra ID sends group object ids unless you change it to send names.

Roles from groups set an organization role. Teams and grants stay as they are in Members and teams; to create teams from groups, use SCIM.

Sign-in rules

Require SSO for verified domains

With the switch on, people on your verified domains can sign in only through your provider. It can be switched on only once at least one verified domain sends people to a provider. Wardn refuses a password or a social sign-in for those addresses, and refuses new password or social sign-ups from them.

  • Guests on other domains are not affected. A contractor with an invitation and an address elsewhere keeps their own way to sign in.
  • An Owner who holds a recovery code can still sign in with their password.

Turn Require SSO on only after Test sign-in works and you have made a recovery code. If the provider is down and nobody has a recovery code, nobody on your verified domains can sign in.

Create accounts on first sign-in

With the switch on, someone on a verified domain who signs in through your provider for the first time joins with the role their groups give them, with no invitation. Their email counts as verified because the domain is.

With it off, a person with no account must hold an invitation first. Existing accounts on a verified domain are linked to the provider at their first SSO sign-in and keep their memberships.

Either way, the sign-up rules in Sign-up modes apply, including the domain allowlist.

Your own sign-in page

A sign-in page on your own subdomain, with your branding and only your provider, is shown on this screen as Enterprise. It is not part of the open product, and nothing on this page needs it. Editions lists what each edition includes.

Accounts nobody has proven

An address is proven once its owner has verified it by email or signed in through a provider that vouches for it. Until then, whoever registered it first could be someone else. When an unproven account is proven, Wardn takes it back: every other way to sign in to it, its sessions and its API keys are removed, and the address counts as verified from then on. In practice:

  • Linking GitHub, Google or your SSO provider to an unproven account removes its password.
  • Verifying an address by email removes every way in that existed before, the password included, so a person who registered the address first keeps no way in. If you registered an address yourself and then verify it, choose Forgot password once afterwards to set a password again.
  • Resetting a password ends every session of the account.

Known limits

  • With sign-up mode sso, people who were invited can still use a password on the invitation they were given. SSO-only mode closes sign-up, not the invitation.
  • An invitation proves access to the mailbox it was sent to, so accepting one does not mark the address verified by itself; it stays unverified until the person verifies it by email or signs in through a provider.

Recovery codes

An Owner can make a recovery code under Sign-in rules: Create recovery code, and New recovery code to replace it.

  • The code is shown once. Wardn keeps only a hash, so it cannot show it again.
  • It works with the Owner's password to sign in when the provider is down, even with Require SSO on.
  • Using it spends it. Make a new one afterwards.
  • Each Owner holds their own. A new code replaces the old one.
  • Store it as you would a root password: in a password manager, apart from the provider.

The code is used together with the Owner's password, so an Owner who has only ever signed in through SSO needs a password first. See Your account.

Signing in

On the sign-in page, a person chooses Continue with SSO, enters their Work email, and Wardn looks the domain up. If an organization verified it, the page shows the organization and the provider and sends them there. If not, it says "No single sign-on for this domain", and they can sign in another way.

Only the organization and provider name for a verified domain are revealed; the lookup says nothing else about who uses Wardn.

Every SSO sign-in is recorded in Activity. The page shows the number of sign-ins per provider in the last 30 days.

What the server refuses

CaseResult
The email's domain is not verified by the provider's organizationRefused. A provider cannot assert an address on a domain it has not proven.
No account, no invitation and Create accounts on first sign-in is offRefused.
Password or social sign-in on a Require SSO domainRefused.
The person's account already belongs to other organizations, and has not signed in through this provider beforeRefused with "This email already has an account in other organizations. Sign in the way you did before." A provider is trusted to vouch for people on its own domain, so it is linked only to an account that is in this organization or in none. Someone who needs SSO into a second organization is invited to it and signs in the way they already do.
An API token tries to change SSO or SCIM settings, or to make an OwnerRefused. Tokens never hold sso:manage or member:approve, whoever's they are.

API

The page's data comes from the Wardn API; the providers themselves are held by the sign-in service in the web app.

api() { curl -fsS -H "Authorization: Bearer $WARDN_TOKEN" -H 'Content-Type: application/json' "$@"; }

api "$WARDN_API_URL/api/v1/sso"
api -X PUT "$WARDN_API_URL/api/v1/sso/settings" \
  -d '{"defaultRole": "viewer", "requireSso": false, "createAccounts": true}'
api -X PUT "$WARDN_API_URL/api/v1/sso/role-mappings" \
  -d '{"items": [{"group": "platform-admins", "role": "admin"}]}'
api -X POST "$WARDN_API_URL/api/v1/sso/domains" -d '{"domain": "acme.example"}'
api -X POST "$WARDN_API_URL/api/v1/sso/domains/acme.example/verify"
EndpointDoes
GET /ssoSettings, role mappings, domains with their TXT records, sign-ins per provider, whether you hold a recovery code.
PUT /sso/settingsDefault role, Require SSO, Create accounts on first sign-in.
PUT /sso/role-mappingsReplace the group-to-role mappings (up to 100).
POST /sso/domains, PUT /sso/domains/{domain}, POST /sso/domains/{domain}/verify, DELETE /sso/domains/{domain}Add a domain and read its record, choose its provider, check it now, remove it.
POST /sso/recovery-codesMake the caller's recovery code.

All need sso:manage. Adding, changing or removing a provider is authorized and recorded in Activity before it is made.

Next

On this page