1. Social login
End users sign into B Brands apps with a social provider. This uses the managed engine’s social sign-in directly, then mints the internal B Brands JWT — it does not use the OAuth IdP, ES256 tokens, or the consent screen.Routes
- The start route requires
redirect_url;format=json(orAccept: application/json) returns JSON instead of a 302. - The
/callbackpage is an HTML bridge that reads the URL fragment (#access_token…) or?code=and forwards it to/callback-redirect. /callback-redirectsets the engine session, auto-registers a profile if needed, and returns the internal B Brands JWT (HS256) plus account data.
Legacy routes exist for additional providers under an earlier API version. The
current flow adds a parametrizable
redirect_url and JSON/deep-link support.2. Internal SSO — the cross-app handshake
When a user logs in via the authentication app and must land on a sibling B Brands app on a different domain, the session is carried with a short-lived signed token in the URL. A small shared internal package handles this.Shared internal SSO package
A small package for consumer apps, with helpers for:The SSO issuer
The authentication app is the centralized login/register/2FA + consent UI. It is the issuer: it signs the handshake token and writes the session cookie directly in server actions (it does not mount the consumer proxy). Same-domain targets redirect without a handshake token; cross-domain targets receive one.The internal SSO exchange (
/api/v3/auth/sso/exchange) is for cross-app session
transfer. It is not the external OAuth client exchange
(/api/v3/oauth/exchange). See Token exchange.