Explore alternative methods for granting Partners access to Klarna Portal when the recommended Deep Link + AP Button approach cannot be implemented due to technical or business constraints.
When the recommended Deep Link + AP Button approach cannot be implemented, Klarna supports two alternative methods:
| Method | Description | When to use |
|---|---|---|
| User Access Management API | API-based access for creating and managing semi-permanent user accounts in Klarna Portal. Users receive invitation emails and set up their own passwords. | For Acquiring Partners without an admin portal or when Partners need to request access through a manual process. |
| Identity Provider (IdP) via SAML | Delegates authentication to your system using SAML v2.0 protocol. You become the Identity Provider, and Klarna acts as the Service Provider. | For Acquiring Partners with advanced technical capabilities to implement SAML IdP, providing seamless single sign-on experience. |
These methods are alternatives to the recommended approach. They may require additional technical implementation or result in less seamless user experience. Discuss with your Klarna representative before choosing an alternative method.
An Identity Provider (IdP) is a system that authenticates users and authorizes their access to applications and services. In this setup, you act as the IdP and Klarna acts as the Service Provider (SP).
By leveraging SAML v2.0, this setup ensures:
Before implementing IdP integration, ensure you have:
Provide Klarna with the required SAML configuration details:
Klarna will complete the necessary configuration to accept SAML assertions from your IdP.
Define and map user attributes from your IdP to the corresponding Klarna Portal users. Required attributes include:
| Attribute | Description | Required |
|---|---|---|
| User's email address (used as unique identifier) | Yes |
| Partner Account ID in Klarna (e.g., krn:partner:global:account:test:MB6KIE1P) | Yes |
| Array of role identifiers (e.g., merchant:admin) | Yes |
| User's first name | Optional |
| User's last name | Optional |
When Partners attempt to access Klarna Portal:
Before going live, test the complete SAML flow:
The SAML IdP solution requires coordination with Klarna for configuration. If you are interested in proceeding with this option for Partner Portal access, please reach out to your Klarna representative to discuss further.
Klarna Portal accounts can be created via createUserAccess
Use the User Access Management API when:
Important: This method requires JWT signing with a client certificate. If you haven't completed the JWT setup yet, follow the JWT signing setup.
After completing the JWT signing setup, create your JWT with the following structure:
Sample header
{
"alg": "ES256",
"typ": "JWT",
"x5c": ["<your_cert_base64>"]
}
Sample payload
{
"iss": "krn:partner:global:account:live:LYABCDEI",
"jti": "a4728c02-9885-41bf-b539-251ffa7f7eaa",
"sub": "portal.user@merchant.com",
"iat": 1716768000,
"exp": 1716892720,
"account_id": "krn:partner:global:account:test:MB6KIE1P",
"on_behalf_of": "krn:partner:global:account:test:MB6KIE1P",
"roles": ["merchant:admin"],
"expires_at": "2024-12-31",
"inactivity_grace_period": "P30D"
}Note: Unlike deep linking, the User Access Management API JWT does not require the amr field.
In addition to the required claims shown above, you can include optional claims to control access duration:
| Claim | Description | Format | Example |
|---|---|---|---|
| The date when the user's access expires. Must be a future date. | YYYY-MM-DD |
|
| How long the access remains valid after user inactivity. Must be between 1 day and 6 months. | ISO 8601 duration |
P3M (3 months) |
See the full JWT parameter documentation here
User access for Partners is created using a POST request to createUserAccess
Request payload:
{
"jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.<....>SMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}
On success, the endpoint responds with 201 Created and dispatches an invitation email to the specified address. If that address is already registered, no new email will be sent.
You can define the level of access granted to the user by setting the roles array in the JWT payload.
What happens next:
sub in JWT)User access can be deleted at any time. Make a DELETE request to deleteUserAccess
| Parameter | Description |
|---|---|
| The Partner Account ID of the access to delete |
| When specified, only the specific access with this on_behalf_of value will be deleted |
| The ID or email of the user to delete the access from |
Warning: If no parameters are supplied, all user access created by you will be deleted.
If both account_id and principal parameters are provided, they are combined to precisely target and delete the user's access to the specified Partner account.
When user access is revoked, the user's access to the Partner account will be removed within 5 minutes.