Klarna Web SDK v2
    Preparing search index...

    Interface IdentitySignInResponse

    Response object for the Identity sign-in flow.

    gated

    interface IdentitySignInResponse {
        customerProfile: KlarnaCustomerProfile;
        idToken: string;
    }
    Index
    customerProfile: KlarnaCustomerProfile
    idToken: string

    OAuth 2.0 ID token in JWT (JSON Web Token) format obtained through OpenID Connect authentication flow.

    The ID token is a signed JWT that contains:

    • Standard OIDC claims: sub (customer ID), aud (audience), iss (issuer), exp (expiration), iat (issued at)
    • Customer profile claims based on requested scopes: email, name, phone, address, date of birth, national identification
    • Security claims: nonce, jti (JWT ID), auth_time, at_hash (access token hash)

    The token can be validated using Klarna's JWKS (JSON Web Key Set) endpoint to verify:

    • Signature authenticity using the public key matching the kid (Key ID) in the token header
    • Token expiration and validity period
    • Issuer and audience claims
    klarna.Identity.on("signin", async (response) => {
    const { idToken } = response;
    // Send idToken to your backend for validation
    await fetch('/api/verify-token', {
    method: 'POST',
    body: JSON.stringify({ idToken })
    });
    });