Invental/Review lessons/Trust boundaries the server must hold

Trust boundaries the server must hold

Scope what an SSO email assertion unlocks

When an external identity provider vouches for an email, scope what that vouching unlocks. A per-workspace assertion should not flip a global “verified” flag on an account that has its own password.

01 · Before and afterThe pattern

TypeScript
// before: any successful SSO sign-in verifies the user everywhere
if (!user.isEmailVerified) await markVerified(user.id);
// after: only accounts that can't log in any other way
if (!user.isEmailVerified && !user.passwordHash) await markVerified(user.id);
// and: display URLs built with the same normaliser the server uses
const acs = new URL(serverUrl); acs.pathname = "/auth/saml/callback";

02 · Run it on your appThe check

If one tenant's admin connects an SSO provider that asserts any email, can that unlock an account in another tenant?

If the honest answer is no or not sure, this is worth a look before it reaches production.

Want this checked on your code?

Tell us what you are building and what worries you. We match a senior reviewer to your code and confirm scope before anything starts.

— Get in touch
hi@invental.co ↗
— Or
— What to include

A link or short description of the code or system, what you want checked, your stack, and when you need the answer. No repository access is needed until scope is agreed.

— Or leave a note
We reply within one business day.