Skip to main content

Single sign-on

With single sign-on, your renters enter Greenlight's enrollment flow already signed in with the account they hold on your platform. They never create a Greenlight password, and someone who is signed in to your product passes straight through the flow's first screen.

Single sign-on is optional and enabled per source. Without it, renters create a Greenlight account or log in with an email and password on the flow's first screen, as described in What the renter does.

How it works​

Greenlight acts as an OpenID Connect relying party, and your identity provider is the OpenID provider.

  1. The renter opens an enrollment URL, embedded or hosted.
  2. If they are not signed in to Greenlight, the flow starts a silent OpenID Connect authorization request to your identity provider, with prompt=none.
  3. If the renter has a session with your identity provider, it returns them immediately, and they arrive in the flow signed in without seeing a login screen.
  4. If they do not, your identity provider answers with an error such as login_required. Greenlight then shows a screen inviting the renter to sign in with your platform, and its button starts an interactive sign-in.
  5. On return, Greenlight signs the renter in to their Greenlight account, creating or linking it as described in Accounts.
  6. If the prospect carries authorized members, Greenlight checks the renter against them before showing the enrollment.

The silent attempt runs once per browser tab. If it fails because the browser drops the frame's cookies, the renter sees the email and password form rather than a loop of redirects.

What Greenlight needs from you​

ItemDetail
Issuer URLYour OpenID provider's issuer, for staging and production. Greenlight does not use discovery: it calls {issuer}/protocol/openid-connect/auth, {issuer}/protocol/openid-connect/token, and {issuer}/protocol/openid-connect/userinfo, so your provider must serve its endpoints at those paths
Client ID and secretA confidential client registered for Greenlight, one per environment
Redirect URIRegister the exact callback URL Greenlight gives you for each environment. Greenlight sends it verbatim and your provider must match it exactly
GrantAuthorization code, with PKCE (S256)
Scopesopenid profile email
Silent authenticationSupport for prompt=none, returning the standard OpenID Connect errors (login_required, interaction_required) when the renter has no session

Greenlight reads the renter's identity from your userinfo endpoint, using these claims:

ClaimUse
subThe renter's permanent identity. Greenlight keys their account on it
emailUsed to create or link the renter's Greenlight account the first time they sign in
email_verifiedMust be true for Greenlight to create or link an account from email

given_name and family_name are requested but not used. The renter's name, phone, birthdate, and SSN come from the prospect, not from your identity provider.

Send these to your Partner Success Manager. Enabling single sign-on for a new source is engineering work on Greenlight's side, not just configuration, so talk to your Partner Success Manager before planning it for a new integration.

Embedding​

Single sign-on works inside the embedded flow. The authorization request runs within the iframe, not in a popup or a top-level redirect, so your identity provider's authorization and login pages must be allowed to load inside your own page's iframe. Check the Content-Security-Policy: frame-ancestors and X-Frame-Options headers your identity provider sends.

The silent attempt only succeeds when the browser lets the frame send your identity provider's session cookie. Browsers that block third-party cookies in frames can prevent that. The renter then sees the sign-in screen and completes an interactive sign-in instead, which still works.

Accounts​

The first time a renter signs in through your identity provider, Greenlight resolves their Greenlight account in this order:

  1. A Greenlight account already linked to this sub. The renter is signed in to it. No email is needed.
  2. A Greenlight account with the same email, when email_verified is true. Your identity is linked to that account, and the renter is signed in to it. This is how a renter who used Greenlight before keeps their existing policies.
  3. Otherwise, a new account with that email, when email_verified is true.

Without a sub, or without a verified email for steps 2 and 3, the sign-in is refused, and the renter sees the email and password form instead.

Once linked, the sub stays tied to that Greenlight account. A renter who later changes their email on your platform still signs in to the same account.

Signing in creates an ordinary Greenlight session. Greenlight does not check your identity provider again during that session, so signing out of your platform does not sign the renter out of an enrollment already open.

Authorized members​

By default, any renter who signs in can open an enrollment URL whose email matches their own. Authorized members tighten that. Send an authorized_members list on the prospect, and only the people on it can open that renter's enrollment.

The list and its fields are in the field reference. This section covers how Greenlight applies it.

Matching​

When a signed-in renter opens the enrollment, Greenlight matches their sub against idp_subject on each live member. Where a member has no idp_subject, it matches sub against member_external_id instead. Send idp_subject whenever you have it, so matching never depends on your member ID equalling the subject.

A renter who matches no member gets a 404, the same page as a prospect that does not exist. A guessed or forwarded URL reveals nothing about the prospect behind it.

The check runs on every step of the flow, not only on entry. Removing a member takes effect on their next page load once Greenlight has processed your update, including midway through checkout.

The list governs everyone. It checks the identity linked to the renter's Greenlight account, not how they signed in, and matching needs a sub from your identity provider. So once a prospect has a list, creating an account on the flow's first screen is refused before any account is made, and a password login to an account not linked to a listed member is refused before the renter is signed in. Both get the same 404. That includes a renter who falls back to the email and password form when the silent sign-in fails, so send renters on such prospects through your identity provider.

Residents and delegates​

Every member is either the resident, the person being insured, or a delegate, someone acting for them, such as a parent paying for a student's lease.

ResidentDelegate
Open the enrollment, see the quote, and payYesYes
Becomes the policyholderYesNo
Prospect details written to their Greenlight accountYesNo

A delegate completes the purchase on the resident's behalf. The policy is the resident's, and nothing the delegate enters is written to the delegate's own account.

Send exactly one resident on a prospect. A member counts as the resident only when they are the sole live resident on the list. With two, both are treated as delegates.

Updating the list​

Each list you send replaces the previous one:

  • Omit authorized_members to leave the list as it is.
  • Send [] to revoke everyone.
  • Send authorized_members_stamped_at with every list, increasing each time. Greenlight ignores a list stamped at or before the one it holds, so a delayed request cannot restore a member you have since removed.

Problems with individual entries, such as a missing member_external_id or the same idp_subject on two members, never fail the request. Greenlight resolves duplicates in favor of the entry with the later verified_at and skips unusable entries. A list in which no entry is usable is ignored rather than read as a revocation.

Move-outs​

Move-out residents carry the same identity fields, idp_subject, verification_method, and verified_at. See Resident fields. An idp_subject must be unique within a move-out.

When a resident has an idp_subject, only someone signed in to Greenlight with that identity on your platform can review, sign, decline, or withdraw their consent request; the emailed link alone is not enough. A renter signed in with a different account is asked to sign in with your platform, or, if your platform offers no renter sign-in to Greenlight, to contact their property. Without an idp_subject, the emailed link is the credential.

Your responsibilities​

Greenlight trusts your identity provider's answer, so its guarantees become Greenlight's:

  • Never reassign a sub. It is the permanent key to a renter's Greenlight account and policies. A reused subject signs the new person in to the previous person's account.
  • Assert email_verified: true only for addresses you have verified. A verified email links your identity to any existing Greenlight account with that address.
  • Keep the authorized members list current. Send an update when someone gains or loses access on your side, rather than waiting for the next scheduled sync.

Troubleshooting​

Renters always see the sign-in screen, never a silent sign-in

  • The browser is blocking your identity provider's cookies inside the frame, or your provider does not support prompt=none
  • Confirm the renter actually has a session with your identity provider in that browser

The sign-in screen loads blank in the iframe

  • Your identity provider's pages refuse to be framed. Check its frame-ancestors and X-Frame-Options headers

Renters land on the email and password form after signing in with your platform

  • email_verified is not true for a first-time renter, or email or sub is missing from userinfo
  • The redirect URI registered with your identity provider does not match the one Greenlight sends exactly

A renter gets "Third party prospect not found" when creating an account or logging in

  • The prospect has an authorized members list, so the renter must sign in with your platform

A renter gets "we couldn't find your offer" after signing in

  • Their sub matches no live authorized member. Check the list you last sent, its idp_subject values, and its authorized_members_stamped_at

Next steps​