1. BFF & the three questions of every login spec

8 cards

Review this deck
All cards in this deck

BFF (Backend-for-Frontend)

A backend layer between the browser/WebView and internal APIs that keeps the session and every token on the server side; the browser only holds a session id in a cookie.

Why fintech picks a BFF holding the session over an SPA holding tokens

Tokens never reach the browser so XSS cannot steal them, revocation is instant by deleting the session in Redis, and the client_secret stays on the server.

Login spec question 1

Who authenticates the user (which IdP) and how the BFF trusts that result (verify the id_token or call a token verify API).

Login spec question 2

Where the login state lives (Redis), for how long (TTL) and when it is deleted (logout, 401, callback finished, business operation completed).

Login spec question 3

What happens on failure: wrong state, access_denied, user blocked, API 5xx, session expired → which screen, which session is deleted, whether cookies are cleared.

Secured (`/api/s/`) vs non-secured (`/api/ns/`) APIs

s = secured, requires a valid session and an XSRF token; ns = non-secured, no session needed (e.g. maintenance status, public config).

MemberPortal login channels

`/auth/web/*` (OIDC with Auth0/Keycloak), `/auth/app/login` (SSO from the native app), `/auth/stepup/*` (re-authentication), `/auth/operator/*` (operations staff), `/auth/mock-session` (testing).

"Tokens never leave the server" principle

access_token, id_token and refresh_token exist only in Redis or BFF memory; never in cookies, URLs, logs or response bodies.

1. BFF & the three questions of every login spec – Flashcards – Login Flow | Học Dev