Test mode: paid plans aren't on sale yet, so nothing is charged. Every plan's limits apply.

← Docs

Apps that sign in with SAML

Most apps sign people in with OpenID Connect (apps). Some only speak SAML 2.0: older enterprise software, or a vendor's product that asks for "your IdP's metadata". For those, Nod is the SAML identity provider (IdP), and the app is a service provider (SP).

Usually the person opens the app, the app sends them to Nod with an AuthnRequest, and Nod posts a signed response back (SP-initiated). An app can also take sign-ins started from Nod (see below).

Registering an app

The app's administrator gives you two things: its entity ID and its assertion consumer service (ACS) URL.

curl -X POST "$ISSUER/api/v1/saml-apps" -H "authorization: Bearer $TOKEN" -H 'content-type: application/json' \
  -d '{"id": "wiki", "name": "Team wiki", "entity_id": "https://wiki.example/saml", "acs_url": "https://wiki.example/saml/acs"}'

You need clients:write to register or delete an app, and clients:read to list them (GET $ISSUER/api/v1/saml-apps, GET …/saml-apps/{id}). Deleting one stops its sign-ins (DELETE …/saml-apps/{id}).

What to give the app

Signing in from Nod (IdP-initiated)

For an app registered with "idp_initiated": true, a link to $ISSUER/saml/apps/<id>/start signs the person in to the app directly. They get Nod's sign-in page first if they aren't signed in. The response answers no request, so it has no InResponseTo. It goes to the registered ACS, with start_relay_state (if set) as its RelayState, which is where the app should land.

Turn this on only for apps that ask for it. An unsolicited response can't be tied to a request the app's browser made, so the app must accept that risk. Nod's own SP side refuses such responses. Apps without the flag get 404 there. Each sign-in is logged as saml.assertion, with detail ending "(started from Nod)".

Signing out (single logout)

An app that signs people out through Nod sends its LogoutRequest to $ISSUER/saml/slo (HTTP-Redirect; the metadata names it). Register its slo_url to get an answer there.

Signing out tells the other apps

When the person signs out of Nod in the browser, Nod tells the SAML apps that session signed in to. This covers Nod's own logout, an OpenID Connect app's logout, or a SAML app's LogoutRequest. Only apps that registered an slo_url are told; the app that asked isn't told again.

Nod's session ends at once. Then the browser goes to each app's slo_url in turn, carrying a LogoutRequest signed by Nod. Each request names the person as that app knows them, with the SessionIndex it was given. Each app answers at $ISSUER/saml/slo, and Nod moves the browser on to the next app. After the last app, the browser goes where it was going: an upstream IdP's logout, the app that asked, or the signed-out page.

Each answer is used once, within ten minutes. An app that registered cert_pem must sign its answers. An answer that doesn't check out ends the chain at the signed-out page. Nod's session is already over by then, so nothing is lost.

Rotating the signing key

Apps pin Nod's certificate, so switching keys takes two steps:

nod saml idp-next-key acme     # a next key, published in the metadata beside the current one, which still signs
# give the new certificate (printed, and in the metadata) to every app that pinned the old one
nod saml idp-switch-key acme   # the next key signs from now on; the old one is gone from the metadata

Apps that read the metadata pick up the next key on their own. The switch is refused when no next key is published, and a second next key is refused until the switch. Both commands go in the realm's security log as admin.change.

What Nod sends

Nod sends one assertion, and signs both the assertion and the response around it (RSA-SHA256, exclusive C14N), so an app that checks either one is covered. The assertion contains:

The RelayState comes back unchanged. SAML limits it to 80 bytes.

Each response goes in the realm's security log as saml.assertion, with client_id set to saml:<app id>.

Signing in again (ForceAuthn)

When a request has ForceAuthn="true", a session from before the request isn't enough. Nod notes when it first saw the request by adding nod_asked=<unix seconds> to the SSO URL. A session that started before then gets the sign-in page, and the page comes back to the same request. Only a sign-in made after that moment is answered.

The request is unsigned, so ForceAuthn protects against a session left open in the browser. It doesn't protect against the person at that browser, who could equally drop the flag.

What Nod refuses

Not yet