Service Our Products Developer docs Enterprise rollout Pricing Company Help Center Check Contact Us
our fees start a rollout business api rollout guide

Protect sign-in

Your normal sign-in runs first. TapSign then asks the user's phone to approve, and your server creates the session only after TapSign confirms.

The flow

  • Your server starts a login approval.
  • The user approves on their phone with a fingerprint or Face ID.
  • Your server confirms the approval with TapSign, then signs the user in.

1. Start the approval (server)

POST /login/approval/start

  • client_key_id: your workspace key. Required.
  • device_ref: the user's TapSign device, saved when they enrolled. Required.
  • channel: web, mobile_app, desktop or extension.
  • requested_mode: cross_device.
  • risk_level: low, normal, high or critical.
  • login_request_id: your own id for this sign-in attempt.

Returns session_id, challenge and expires_at.

app.post('/login', async (req, res) => { const user = await checkPassword(req.body); // your existing sign-in if (!user) return res.status(401).json({ error: 'invalid_credentials' }); const start = await tapsign.post('/login/approval/start', { client_key_id: process.env.TAPSIGN_CLIENT_KEY_ID, device_ref: user.tapsignDeviceRef, channel: 'web', requested_mode: 'cross_device', risk_level: 'high', login_request_id: crypto.randomUUID(), }); await pending.save(start.session_id, user.id); // hold the sign-in, issue nothing yet res.json({ approvalRequired: true, sessionId: start.session_id }); });

2. Wait for the phone (website)

Show "Approve on your phone" and poll your own server. Your server reads the status from TapSign.

GET /login/approval/status?client_key_id=...&session_id=...

Status is pending, approved, denied or expired.

async function waitForApproval(sessionId) { for (;;) { const { status } = await fetch(`/login/status?sessionId=${sessionId}`).then((r) => r.json()); if (status === 'approved') return completeLogin(sessionId); if (status === 'denied' || status === 'expired') return showRetry(); await new Promise((r) => setTimeout(r, 2000)); } }

3. Confirm and sign in (server)

POST /auth/session/consume

  • client_key_id: your workspace key.
  • session_id: from step 1.
  • action: login_step_up.
  • request_context: the same value every time for this kind of action, for example login:USER_ID.

Create the session only when this returns HTTP 200. Any other answer, or no answer, means no sign-in.

app.post('/login/complete', async (req, res) => { const userId = await pending.take(req.body.sessionId); if (!userId) return res.status(410).json({ error: 'expired' }); try { await tapsign.post('/auth/session/consume', { client_key_id: process.env.TAPSIGN_CLIENT_KEY_ID, session_id: req.body.sessionId, action: 'login_step_up', request_context: `login:${userId}`, }); } catch { return res.status(403).json({ error: 'not_approved' }); } res.json(await createSession(userId)); });

Enrol the user's phone

A user approves with a phone they enrolled once.

POST /device/bootstrap/token with purpose register returns bootstrap_session_id, deep_link_url and expires_at.

  • Website on a computer: show deep_link_url as a QR code for the TapSign app to scan.
  • Website on a phone: show an "Open in the app" button with the same link.
  • Your own mobile app: enrol inside the app with the TapSign SDK. See Mobile apps.

When the user has finished, call POST /device/bootstrap/resolve with the bootstrap_session_id and save bound_public_device_ref as the user's device_ref.

Your approval device is one download away.

Join the teams already protecting login, admin actions and deployments with TapSign.

Get it on Google Play Download on the App Store