Security

Identity Provider & SSO (Entra ID / OIDC)

Intermediate

Authentication is already solved, by specialists, over decades. Use a proven identity provider and standard protocols (Entra ID / OpenID Connect / OAuth 2.0) instead of building your own login, token format, or session scheme. Hand-built auth is where small but serious mistakes hide, and it is almost never worth it.

A managed identity provider gives you MFA, conditional access, account lifecycle, brute-force protection, key rotation, token revocation, and federation — built correctly and kept up to date — for free. Building any of that yourself means writing security-critical code that the whole company then depends on, and getting it as right as a dedicated vendor, forever.

The Finperiti audit is the warning: authentication was a home-built symmetric HS256 JWT scheme with a single shared secret, instead of Entra ID / MSAL SSO. A shared symmetric secret means anyone who can validate a token can forge one, and one leak compromises every tenant. A proper IdP with asymmetric, rotated keys removes that failure mode. Standardise on the IdP and integrate cleanly with it.

Use a proven identity provider

Home-rolled symmetric JWT // shared secret in config, same across tenants/environments
var token = JwtBuilder.Create().WithSecret("shared-hs256-secret")
.AddClaim("role","admin").Encode();

Symmetric signing means anyone who holds the secret can mint admin tokens, and one leak breaks every tenant — the Finperiti finding. There is also no MFA, lockout, revocation, or rotation. All of it is rebuilt, badly.

Entra ID via MSAL / OIDC // app delegates auth to Entra ID and validates tokens against its JWKS
builder.Services.AddAuthentication().AddMicrosoftIdentityWebApi(config);
// tokens are asymmetrically signed, with MFA and conditional access enforced by the IdP

MFA, lockout, rotation, and revocation come from the IdP. Tokens are asymmetrically signed, so verifiers cannot forge. There is no shared secret to leak. Far less code, far more secure.

Integrate cleanly

Self-review checklist

Why it matters: Authentication is high-stakes and harder than it looks. The failure modes — forgeable tokens, no revocation, missing MFA, shared secrets — are exactly what sank the Finperiti auth design. A proven identity provider gives us correct, maintained, certifiable authentication out of the box, frees us from storing passwords and secrets, and removes a whole class of breach we would otherwise own forever.