Skip to main content

Concepts

This page explains the terms used throughout the documentation and how an eID flow behaves from start to finish.

Accounts and credentials​

IDkollen has two APIs, and each has its own credentials:

APIEndpointsUsernamePasswordUsed for
eID APIBankID, Freja, MitID, Vipps, FTN, documentsaccountIdsecretKeyAuthentication, signing, age verification
Data APITeleID, TeleSign, SafeMail, users and servicesapiKeysecretKeyWorking with the data in your IDkollen portal

Both are sent with Basic Auth. Keys for one API don't work on the other.

  • Account: an eID API customer, identified by its accountId. Settings such as whitelisted callback and redirect URLs, the HMAC key and add-on features are configured per account.
  • Company: your organization in the IDkollen portal, which the Data API works with.
  • Master key: one set of credentials for several accounts. See Master keys.
  • Staging and live: two separate environments, each with its own keys. See Testing.
  • Add-on: a feature that must be enabled for your account before use, such as backchannel authentication or requestAddress. Using it before it is enabled returns 403.

Master keys​

If you manage several companies or brands, you can use a single master key instead of a separate set of keys for each brand. Each brand is then identified by its ID in the X-Client-Id header of every request:

POST /v3/bankid-no/auth
Authorization: Basic ${ base64(masterAccountId + ':' + secretKey) }
X-Client-Id: {BrandId}

You can request a master key from your sales contact or from support@idkollen.se.

Flows​

Every authentication, signing or age verification is a flow. You start a flow with a POST, and get back an id.

FieldSet byDescription
idIDkollenIdentifies the flow. Use it to fetch the result or cancel the flow.
refIdYouOptional. Your own reference, such as an order or session ID. It is returned in the result, the callback and the redirect, so you can match them to your own records.

Status​

A flow is always in one of three states:

  • PENDING: waiting for the user. The response tells you how to bring the user to their eID (a QR code, an app link or a url to redirect to).
  • COMPLETED: the user finished. The response holds the result, such as the user's name and SSN.
  • FAILED: the flow ended without a result. error tells you why, for example CANCELLED or SESSION_TIMEOUT.

COMPLETED and FAILED are final. A flow never changes once it has reached one of them.

Getting the result​

There are two ways to learn that a flow has finished, and you can use both:

  • Polling: call the flow's GET endpoint about once a second until the status is not PENDING.
  • Callbacks: IDkollen POSTs the result to your server when the flow finishes. See Callbacks.

Callbacks are not retried, so polling is the more robust choice, or a useful fallback if you use callbacks.

How long a flow lives​

  • How long the user has to finish is decided by the eID provider. When that time runs out, the flow becomes FAILED with SESSION_TIMEOUT.
  • A flow is kept for about 15 minutes after its last change. After that, its GET endpoint returns 404. Fetch and store the result as soon as the flow is finished.
  • A flow can be cancelled with its DELETE endpoint while it is PENDING, for example when the user clicks "Cancel" on your site, so the user can start over.

Starting the user's eID​

Depending on the eID, the user is brought to their eID in one of these ways:

WayeIDsHow
QR codeBankID (SE), Freja eIDShow a QR code on your page. The user scans it with the eID app on their phone.
App startBankID (SE), Freja eIDOpen the eID app on the same device, using the autoStartToken.
RedirectBankID (NO), MitID, Vipps, FTN, age verificationSend the user to url. They are sent back to your redirect URL when they are done.
BackchannelBankID (SE) phone, BankID (NO), Freja, MitID, VippsStart the flow from your server with the user's SSN or phone number. The user approves in their app.

Each eID's introduction page has a Choosing a flow section that helps you pick.

Formats​

TypeFormatExample
Dateyyyy-MM-dd2024-01-15
TimestampISO-8601, UTC2024-01-15T13:37:00Z
SSN, SwedenYYYYMMDDXXXX. Ten digits and a hyphen are also accepted.199001011239
SSN, Norway11 digits, DDMMYYXXXXX, hyphen optional20123931743
SSN, Denmark10 digits, DDMMYYXXXX, hyphen optional0101901234
SSN, FinlandDDMMYYCZZZQ, where C is the century sign131052-308T
Organization numberSwedish organization number, hyphen optional559000-0948
CountryUpper-case English nameSWEDEN, NORWAY

Optional fields can be left out or sent as null, which means the same thing. Fields that have no value in a response may be left out or be null, so handle both.

Callers and users​

  • You (called the partner in some places): the company integrating with IDkollen.
  • User or end user: the person who authenticates or signs.
  • Agent: in the Data API, the employee in your company on whose behalf a TeleID, TeleSign or SafeMail is sent. An agent is a user in your IDkollen portal, identified by SSN, username or SSO nameId.