Step 2: Web app (SDK)
⚡ 3 min readCall redirectToStepUp before a sensitive action. The SDK asks the backend for an RBAC decision, opens Transcodes Auth in a new tab when needed, polls the session, and resolves in the same page (waiting overlay — no full redirect).
Call step-up
const res = await transcodes.redirectToStepUp({
resource: 'documents',
action: 'delete',
comment: 'Delete invoice #1042',
});
const gate = res.payload[0];decision | Meaning |
|---|---|
allow | Level 1 — proceed immediately |
deny | Level 0 — blocked (res.success may still be true; check decision) |
stepup | Level 2 — human must complete MFA; then check status |
After decision: 'stepup'
Polling runs until status === 'verified' or 'rejected', or the user closes the waiting overlay.
const ok =
res.success &&
(gate?.decision === 'allow' ||
(gate?.decision === 'stepup' && gate?.status === 'verified'));
if (ok) {
await deleteDocument();
}Do not treat res.success alone as approval. A deny can return success: true with decision: 'deny'.
What the SDK does internally
POST /auth/temp-session/step-up/redirect-sessionwithresource,action,redirectUri- Opens auth URL (
tc_mode=stepup) in a new tab - Polls
GET …/step-up/session/:siduntilverifiedorrejected - Returns
{ decision, status, sid, resource, action }to your app
MFA and audit logging on the auth page happen on Transcodes Auth — not in your bundle.
Last updated on