Skip to main content

Identity Broker Overview

The Gold Standard for Enterprise Authentication. Implements the Backend-For-Frontend (BFF) pattern to secure SPAs by keeping tokens out of the browser.

Why Identity Broker?

Modern security standards (OWASP 2026) discourage storing access tokens in the browser (LocalStorage/SessionStorage) due to XSS risks. The Identity Broker handles all token exchanges on the server and issues a secure, encrypted, partitioned cookie to the frontend.

FeatureClient-Side Auth (Standard)Identity Broker (BFF)
Token StorageLocalStorage (Vulnerable to XSS)HttpOnly Cookie (Secure)
EncryptionNone (JWT visible)AES-256 Encrypted Cookie
CSRFRely on SamesiteDouble-Submit Cookie Pattern
Privacy3rd Party Cookies (Blocked by Safari)First-Party Context

Decision guide

  • Identity Validator: Use this if your APIs already receive JWTs and only need token validation.
  • Identity Broker: Use this if you need a complete login experience for a browser app and want secure cookie sessions.
  • Both: Use Broker for the SPA and Validator for downstream APIs.

See: Identity Validator Overview


Supported Providers

The broker supports seamless integration with major enterprise identity providers.

Key Capabilities

Zero-Knowledge Frontend

The frontend application never sees the Access Token. It only holds a session cookie. This renders XSS attacks ineffective for token theft.

Just-In-Time (JIT) Provisioning

Automatically provision users in your local database when they log in via a trusted provider (like a corporate Azure AD).

Advanced Security

  • AES-256 Encryption: Upstream tokens are encrypted at rest.
  • Partitioned Cookies (CHIPS): Future-proofs your app against browser privacy sandboxes.
  • Strict CSRF: Validates custom headers against a secure cookie.

Roadmap

The following features are planned for upcoming releases:

  • Sign up / invite flows
  • Email verification
  • Forgot / reset password and change password
  • MFA / passkeys
  • Session list and revoke (log out other devices)
  • Account linking and organization/tenant management

Next Steps

Technical Specifications

FeatureDefault ValueDescription
Session Lifetime60 MinutesDefined by Jwt:ExpiryInMinutes.
Sliding ExpirationEnabledSession resets on every active request.
Cookie NamePrimus.SessionPrefixed with __Host- in non-development environments.
CSRF HeaderX-Primus-CSRFRequired on POST/PUT/DELETE. Prevents Cross-Site Request Forgery.
Account Lockout5 AttemptsAccounts lock after 5 failed tries.
EncryptionAES-256Military-grade encryption for upstream tokens.