Headless login needs a client that uses your own BankID certificate, so the BankID app shows
your company name. Clients in a sandbox organization run against the BankID mock instead. The
calls use your sajn API key with the
login:write and login:read scopes.1. Create a session
Create the session as in the Session API. Keep theid.
Headless login doesn’t use loginUrl.
2. Start an attempt
Call this from your server when the user chooses to log in. Send the user’s IP address as your server sees it, never your server’s own address.Response
3. Show the QR code or the button
- Another device: render
qrCodeas a QR code. It changes every second, so show the new value from each poll. - The same device: open
autoStartUrlfrom a tap. iOS blocks an app switch that no tap started. To build your own link, useautoStartToken.
4. Poll until the attempt ends
Poll every 1 to 2 seconds and show the newqrCode while status is PENDING.
Pending
The login completes even if you stop polling, and
login.completed fires. Calling start again
while an attempt runs returns that attempt with its current qrCode.
5. Read the result
Whenstatus is COMPLETED, read the claims with
GET /api/v1/login/sessions/{id}.
The poll response carries no identity. The authenticated read is the only place your server learns
who logged in.
Cancel an attempt
When the user presses Cancel, cancel the attempt so the BankID app stops waiting:status is COMPLETED.
Errors
Reference
Start
POST …/startPoll
POST …/pollCancel
POST …/cancel
