Authentication
Start authentication
The POST /v3/vipps/auth endpoint is used to start an authentication using Vipps.
POST /v3/vipps/auth
Authorization: Basic ${ base64(accountId + ':' + secretKey) }
{
"requestSsn": false,
"requestEmail": false,
"requestPhone": false,
"requestAddress": false,
"refId": "12398698",
"redirectUrl": "https://..."
}
- curl
- C#
- Dart
- Go
- JavaScript
- Java / Kotlin
- PHP
- Python
- Ruby
- Rust
- Swift
curl -u "$ACCOUNT_ID:$SECRET_KEY" https://api.idkollen.se/v3/vipps/auth \
-H 'Content-Type: application/json' \
-d '{
"redirectUrl": "https://example.com/return",
"requestSsn": false,
"requestPhone": false,
"requestEmail": false,
"requestAddress": false,
"refId": "12398698"
}'
var status = await client.Vipps.AuthAsync(new VippsAuthRequest
{
RedirectUrl = "https://example.com/return",
RequestSsn = false,
RequestPhone = false,
RequestEmail = false,
RequestAddress = false,
RefId = "12398698",
});
final status = await client.vipps.auth(const VippsAuthRequest(
redirectUrl: 'https://example.com/return',
requestSsn: false,
requestPhone: false,
requestEmail: false,
requestAddress: false,
refId: '12398698',
));
// func ptr[T any](v T) *T { return &v }
status, err := client.Vipps().Auth(ctx, identisure.VippsAuthRequest{
RedirectUrl: ptr("https://example.com/return"),
RequestSsn: ptr(false),
RequestPhone: ptr(false),
RequestEmail: ptr(false),
RequestAddress: ptr(false),
RefId: ptr("12398698"),
})
const status = await client.vipps().auth({
redirectUrl: "https://example.com/return",
requestSsn: false,
requestPhone: false,
requestEmail: false,
requestAddress: false,
refId: "12398698",
});
import com.identisure.client.models.*;
var status = client.vipps().auth(new VippsAuthRequest()
.setRedirectUrl("https://example.com/return")
.setRequestSsn(false)
.setRequestPhone(false)
.setRequestEmail(false)
.setRequestAddress(false)
.setRefId("12398698")
).join();
use Identisure\Client\Models\Vipps\VippsAuthRequest;
$status = $client->vipps()->auth(new VippsAuthRequest(
redirectUrl: 'https://example.com/return',
requestSsn: false,
requestPhone: false,
requestEmail: false,
requestAddress: false,
refId: '12398698',
));
from identisure_client.models import VippsAuthRequest
status = client.vipps().auth(
VippsAuthRequest(
redirect_url="https://example.com/return",
request_ssn=False,
request_phone=False,
request_email=False,
request_address=False,
ref_id="12398698",
)
)
status = client.vipps.auth(
Identisure::Vipps::AuthRequest.new(
redirect_url: 'https://example.com/return',
request_ssn: false,
request_phone: false,
request_email: false,
request_address: false,
ref_id: '12398698',
)
)
use identisure_client::models::{Url, VippsAuthRequest};
let request = VippsAuthRequest::new()
.redirect_url(Url::parse("https://example.com/return")?)
.request_ssn(false)
.request_phone(false)
.request_email(false)
.request_address(false)
.ref_id("12398698");
let status = client.vipps().auth(request).await?;
let status = try await client.vipps.auth(VippsAuthRequest(
redirectUrl: "https://example.com/return",
requestSsn: false,
requestPhone: false,
requestEmail: false,
requestAddress: false,
refId: "12398698"
))
| Parameter | Required | Description |
|---|---|---|
| requestSsn | No | (DEPRECATED) If set, will request the SSN of the authenticated user. The functionality needs to be enabled for your company. Will be removed at the end of 2026. |
| requestEmail | No | If set, will request the e-mail address of the authenticated user. The functionality needs to be enabled for your company. Contact support to enable requestEmail. |
| requestPhone | No | If set, will request the phone number of the authenticated user. The functionality needs to be enabled for your company. Contact support to enable requestPhone. |
| requestAddress | No | If set, will request the address of the authenticated user. The functionality needs to be enabled for your company. Contact support to enable requestAddress. |
| refId | No | Reference ID which will be included in the result and in the redirect. |
| redirectUrl | No | Custom redirect URL, must be whitelisted. |
Response:
IDkollen will respond with HTTP status 201 for successful request, or 4xx/5xx on errors. For more information about errors, please see the Errors section.
{
"id": "1668b9da-bff1-4dfc-ad48-60507b5a8d12",
"refId": "12398698",
"status": "PENDING",
"url": "https://..."
}
| Property | Description |
|---|---|
| id | Authentication id, used to cancel or get the status of this authentication request. |
| refId | The refId given in the request, if any. |
| url | The URL where the end user can identify themselves. |
Code redirect:
Once the end user has authenticated, they will be redirected to the redirect URL provided to IDkollen by you, including the very same "id" as a request parameter that can be used to fetch the result. If the parameter "refId" was used in the request, it will also be included as a request parameter.
https://your.redirect.url/?id=1668b9da-bff1-4dfc-ad48-60507b5a8d12&refId=12398698
A whole domain may also be whitelisted and sent with each request, but must for security reasons be whitelisted first. Multiple domains may be whitelisted. Please provide your whitelisted URLs by emailing us at support@idkollen.se.
Backchannel Auth
The POST /v3/vipps/backchannel/auth endpoint can be used to start an authentication using Vipps over the wire.
This method will trigger the users Vipps app to start the authentication using a phone number alone. During authentication, the user will be prompted to select the matching "binding message" associated with your session.
This is an addon feature. Contact us at support@idkollen.se to enable this feature.
POST /v3/vipps/backchannel/auth
Authorization: Basic ${ base64(accountId + ':' + secretKey) }
{
"phone": "4791234567",
"requestSsn": false,
"requestEmail": false,
"requestAddress": false,
"callbackUrl": "https://...",
"refId": "12398698"
}
- curl
- C#
- Dart
- Go
- JavaScript
- Java / Kotlin
- PHP
- Python
- Ruby
- Rust
- Swift
curl -u "$ACCOUNT_ID:$SECRET_KEY" https://api.idkollen.se/v3/vipps/backchannel/auth \
-H 'Content-Type: application/json' \
-d '{
"phone": "123456789",
"requestSsn": false,
"requestEmail": false,
"requestAddress": false,
"callbackUrl": "https://example.com/callback",
"refId": "12398698"
}'
var status = await client.Vipps.BackchannelAuthAsync(new VippsBackchannelAuthRequest("123456789")
{
RequestSsn = false,
RequestEmail = false,
RequestAddress = false,
CallbackUrl = "https://example.com/callback",
RefId = "12398698",
});
final status = await client.vipps.backchannelAuth(const VippsBackchannelAuthRequest(
phone: '123456789',
requestSsn: false,
requestEmail: false,
requestAddress: false,
callbackUrl: 'https://example.com/callback',
refId: '12398698',
));
// func ptr[T any](v T) *T { return &v }
status, err := client.Vipps().BackchannelAuth(ctx, identisure.VippsBackchannelAuthRequest{
Phone: "123456789",
RequestSsn: ptr(false),
RequestEmail: ptr(false),
RequestAddress: ptr(false),
CallbackUrl: ptr("https://example.com/callback"),
RefId: ptr("12398698"),
})
const status = await client.vipps().backchannelAuth({
phone: "123456789",
requestSsn: false,
requestEmail: false,
requestAddress: false,
callbackUrl: "https://example.com/callback",
refId: "12398698",
});
import com.identisure.client.models.*;
var status = client.vipps().backchannelAuth(new VippsBackchannelAuthRequest()
.setPhone("123456789")
.setRequestSsn(false)
.setRequestEmail(false)
.setRequestAddress(false)
.setCallbackUrl("https://example.com/callback")
.setRefId("12398698")
).join();
use Identisure\Client\Models\Vipps\VippsBackchannelAuthRequest;
$status = $client->vipps()->backchannelAuth(new VippsBackchannelAuthRequest(
phone: '123456789',
requestSsn: false,
requestEmail: false,
requestAddress: false,
callbackUrl: 'https://example.com/callback',
refId: '12398698',
));
from identisure_client.models import VippsBackchannelAuthRequest
status = client.vipps().backchannel_auth(
VippsBackchannelAuthRequest(
phone="123456789",
request_ssn=False,
request_email=False,
request_address=False,
callback_url="https://example.com/callback",
ref_id="12398698",
)
)
status = client.vipps.backchannel_auth(
Identisure::Vipps::BackchannelAuthRequest.new(
phone: '123456789',
request_ssn: false,
request_email: false,
request_address: false,
callback_url: 'https://example.com/callback',
ref_id: '12398698',
)
)
use identisure_client::models::{Url, VippsBackchannelAuthRequest};
let request = VippsBackchannelAuthRequest::new("123456789")
.request_ssn(false)
.request_email(false)
.request_address(false)
.callback_url(Url::parse("https://example.com/callback")?)
.ref_id("12398698");
let status = client.vipps().backchannel_auth(request).await?;
let status = try await client.vipps.backchannelAuth(VippsBackchannelAuthRequest(
phone: "123456789",
requestSsn: false,
requestEmail: false,
requestAddress: false,
callbackUrl: "https://example.com/callback",
refId: "12398698"
))
| Parameter | Required | Description |
|---|---|---|
| phone | Yes | The phone number of the user to authenticate, with country code and without +, such as 4791234567. |
| requestSsn | No | (DEPRECATED) If set, will request the SSN of the authenticated user. The functionality needs to be enabled for your company. Will be removed at the end of 2026. |
| requestEmail | No | If set, will request the e-mail address of the authenticated user. The functionality needs to be enabled for your company. Contact support to enable requestEmail. |
| requestAddress | No | If set, will request the address of the authenticated user. The functionality needs to be enabled for your company. Contact support to enable requestAddress. |
| callbackUrl | No | Custom callback URL, must be whitelisted. See Callbacks. |
| refId | No | Reference ID which will be included in the result. |
IDkollen will respond with HTTP status 201 for successful request, or 4xx/5xx on errors. For more information about errors, please see the Errors section.
{
"id": "1668b9da-bff1-4dfc-ad48-60507b5a8d12",
"refId": "12398698",
"status": "PENDING"
}
| Property | Description |
|---|---|
| id | Authentication id, used to cancel or get the status of this authentication request. |
| refId | The refId given in the request, if any. |
Fetch result
The GET /v3/vipps/auth/{{id}} endpoint is used to check the status of an auth request.
NOTE: This endpoint is rate limited to one request per second. See Errors.
GET /v3/vipps/auth/{{id}}
Authorization: Basic ${ base64(accountId + ':' + secretKey) }
- curl
- C#
- Dart
- Go
- JavaScript
- Java / Kotlin
- PHP
- Python
- Ruby
- Rust
- Swift
curl -u "$ACCOUNT_ID:$SECRET_KEY" https://api.idkollen.se/v3/vipps/auth/$ID
var status = await client.Vipps.AuthStatusAsync(id);
final status = await client.vipps.authStatus(id);
status, err := client.Vipps().AuthStatus(ctx, id)
const status = await client.vipps().authStatus(id);
var status = client.vipps().authStatus(id).join();
$status = $client->vipps()->authStatus($id);
status = client.vipps().auth_status(id)
status = client.vipps.auth_status(id)
let status = client.vipps().auth_status(&id).await?;
let status = try await client.vipps.authStatus(id: id)
This endpoint will respond with a HTTP status of 404 if the authentication session has expired.
The status of an authentication can be either one of: PENDING, COMPLETED or FAILED.
Pending
{
"id": "1668b9da-bff1-4dfc-ad48-60507b5a8d12",
"refId": "12398698",
"status": "PENDING"
}
| Parameter | Description |
|---|---|
| refId | The refId given in the request, if any. |
Completed
{
"id": "1668b9da-bff1-4dfc-ad48-60507b5a8d12",
"refId": "12398698",
"status": "COMPLETED",
"ssn": "YYYYMMDDXXXX",
"name": "Firstname Lastname",
"givenName": "Firstname",
"surname": "Lastname",
"birthDate": "1908-09-29",
"email": "E-mail",
"phone": "Phone number",
"address": "Address",
"pid": "5e1b1e1f-3c2d-4a5b-8c9d-0e1f2a3b4c5d",
"bankId": "5e1b1e1f-3c2d-4a5b-8c9d-0e1f2a3b4c5d",
"authenticatedAt": "2024-01-15T13:37:00Z"
}
| Parameter | Description |
|---|---|
| refId | The refId given in the request, if any. |
| ssn | (DEPRECATED) The personal identification number of the authenticated user. null if requestSsn was unset. Will be removed at the end of 2026. |
| name | The full name of the authenticated user. |
| givenName | The given name of the authenticated user. |
| surname | The surname of the authenticated user. |
| birthDate | The birth date of the authenticated user (yyyy-MM-dd). |
(BETA) An e-mail address of the authenticated user. May be null if requestEmail was unset, if no such data is available, or if the user declined to share it. | |
| phone | (BETA) A phone numer of the authenticated user. May be null if requestPhone was unset, if no such data is available, or if the user declined to share it. |
| address | (BETA) An address of the authenticated user. May be null if requestAddress was unset, if no such data is available, or if the user declined to share it. |
| pid | A stable identifier for the user (the OpenID Connect subject). Use this as the persistent key for a returning user. |
| bankId | Vipps's unique, per-account identifier for the authenticated user. Stable across logins, so you can store it to recognise a returning user (the same value as pid). |
| authenticatedAt | The time the authentication completed (ISO-8601). |
Failed
{
"id": "1668b9da-bff1-4dfc-ad48-60507b5a8d12",
"refId": "12398698",
"status": "FAILED",
"error": "INVALID_ID"
}
| Parameter | Description |
|---|---|
| refId | The refId given in the request, if any. |
| error | An error code describing the reason for why the authentication failed. |
The error may be one of the following values:
| Code | Description |
|---|---|
| AUTH_FAILED | A generic code for any kind of failure. |
| CANCELLED | The authentication was cancelled either by the user or the partner. |
| INVALID_ID | The ID has expired or is otherwise invalid. |
| INTERNAL_ERROR | An internal error occurred causing the authentication to fail. |
| SESSION_TIMEOUT | The authentication expired or timed out. |
| UNSUPPORTED_CLIENT | The client used for the authentication is not supported. |
New error codes may be added in the future without prior notice. The partner should therefore handle unknown error codes in their implementations.
Cancel authentication
The DELETE /v3/vipps/auth/{{id}} endpoint is used to cancel an ongoing Vipps authentication.
DELETE /v3/vipps/auth/{{id}}
Authorization: Basic ${ base64(accountId + ':' + secretKey) }
- curl
- C#
- Dart
- Go
- JavaScript
- Java / Kotlin
- PHP
- Python
- Ruby
- Rust
- Swift
curl -u "$ACCOUNT_ID:$SECRET_KEY" -X DELETE https://api.idkollen.se/v3/vipps/auth/$ID
await client.Vipps.CancelAuthAsync(id);
await client.vipps.cancelAuth(id);
err := client.Vipps().CancelAuth(ctx, id)
await client.vipps().cancelAuth(id);
client.vipps().cancelAuth(id).join();
$client->vipps()->cancelAuth($id);
client.vipps().cancel_auth(id)
client.vipps.cancel_auth(id)
client.vipps().cancel_auth(&id).await?;
try await client.vipps.cancelAuth(id: id)
IDkollen will respond with HTTP status 204 for successful request, or 4xx/5xx on errors. For more information about errors, please see the Errors section.