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:
| API | Endpoints | Username | Password | Used for |
|---|---|---|---|---|
| eID API | BankID, Freja, MitID, Vipps, FTN, documents | accountId | secretKey | Authentication, signing, age verification |
| Data API | TeleID, TeleSign, SafeMail, users and services | apiKey | secretKey | Working 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 returns403.
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.
| Field | Set by | Description |
|---|---|---|
id | IDkollen | Identifies the flow. Use it to fetch the result or cancel the flow. |
refId | You | Optional. 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 aurlto 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.errortells you why, for exampleCANCELLEDorSESSION_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
GETendpoint about once a second until the status is notPENDING. - 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
FAILEDwithSESSION_TIMEOUT. - A flow is kept for about 15 minutes after its last change. After that, its
GETendpoint returns404. Fetch and store the result as soon as the flow is finished. - A flow can be cancelled with its
DELETEendpoint while it isPENDING, 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:
| Way | eIDs | How |
|---|---|---|
| QR code | BankID (SE), Freja eID | Show a QR code on your page. The user scans it with the eID app on their phone. |
| App start | BankID (SE), Freja eID | Open the eID app on the same device, using the autoStartToken. |
| Redirect | BankID (NO), MitID, Vipps, FTN, age verification | Send the user to url. They are sent back to your redirect URL when they are done. |
| Backchannel | BankID (SE) phone, BankID (NO), Freja, MitID, Vipps | Start 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
| Type | Format | Example |
|---|---|---|
| Date | yyyy-MM-dd | 2024-01-15 |
| Timestamp | ISO-8601, UTC | 2024-01-15T13:37:00Z |
| SSN, Sweden | YYYYMMDDXXXX. Ten digits and a hyphen are also accepted. | 199001011239 |
| SSN, Norway | 11 digits, DDMMYYXXXXX, hyphen optional | 20123931743 |
| SSN, Denmark | 10 digits, DDMMYYXXXX, hyphen optional | 0101901234 |
| SSN, Finland | DDMMYYCZZZQ, where C is the century sign | 131052-308T |
| Organization number | Swedish organization number, hyphen optional | 559000-0948 |
| Country | Upper-case English name | SWEDEN, 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.