FILTER BY TAG
Limited Availability

Create a Client Assertion JWT

Before your system can request permission to act on-behalf of another organization, your system must create a client assertion. A
client assertion
is a signed JWT string. Your system must include this string as the
client_assertion
header claim value when it requests an access and refresh token. Follow these steps to create and sign a client assertion:
  1. Create a JWT header using these header fields:
    JWT Header Fields
    Header Field
    Description
    alg
    The asymmetric algorithm you use to sign the token header. These algorithms are supported:
    • RS256 (default)
    • RS384
    • RS512
    • PS256
    • PS384
    • PS512
    kid
    The key ID you use to digitally sign the JWT. It must be registered with the authorizing server. It is the key ID from your P12 certificate.
    typ
    The token type. Set to
    JWT
    .
    { "alg": "RS256", "kid": "your_p12_key_id", "typ": "JWT" }
  2. Construct the JWT payload as a JSON object that contains these required body claims:
    JWT Body Claim Fields
    Body Claim Field
    Description
    aud
    Set to the
    Cybersource
    token endpoint. This is the audience of the JWT.
    exp
    The expiration time, in Unix epoch seconds. Keep the amount of time the token is valid short.
    iat
    The time at which the token is issued in Unix epoch seconds.
    iss
    The issuer of the JWT. Set to one of these possible values:
    • For embedded components, set to the partner organization ID.
    • For remote MCP direct access, set to the merchant ID.
    jti
    A unique JWT identifier, such as a UUID. This value must be unique for each request to help prevent replay attacks.
    scope
    The scopes requested by your application. Set to one of these possible values:
    • For embedded components, set to
      boarding
      .
    • For remote MCP direct access, set to
      transaction_search user_management
      .
    sub
    Subject of the JWT. Set to your application's client ID, which is the
    client_id
    value.
    v-c-merchant-id
    The organization or merchant that the access token is created for. Set to one of these possible values:
    • For embedded components, set to the portfolio organization ID or merchant ID.
    • For remote MCP direct access, set to the merchant ID.
    v-c-response-mle-kid
    The key identifier for message-level encryption (MLE) of the response.
    { "iss": "partner_org_id", "sub": "client_id", "aud": "https://api.cybersource.com/oauth2/v4/token", "jti": "f3d0a7c2-5e8b-4c9a-b1d3-e4f5a6b7c8d9", "exp": 1699565100, "iat": 1699564800, "v-c-merchant-id": "Portfolio Org ID or Merchant ID", "scope": "boarding", "v-c-response-mle-kid": "50622d914e4bc08352af3d50bce77120" }
  3. Encode the JWT header and payload using Base64URL.
    {base64url_encoded_header}
    {base64url_encoded_payload}
  4. Create the signing input by combining the encoded header and encoded payload.
    {base64url_encoded_header}.{base64url_encoded_payload}
  5. Sign the JWT with the private key from your P12 certificate. Use the P12 certificate that is registered to your OAuth application, platform, or system.
    This is a conceptual example for how to obtain the encoded signature using Base64URL:
    sign("{base64url_header}.{base64url_payload}", private_key) = {base64url_encoded_signature}
  6. Combine the encoded header, payload, and signature with the period character (
    .
    ) separating each variable. This creates the signed client assertion JWT.
    {base64url__encoded_header}.{base64url_encoded_payload}.{base64url_encoded_signature}
    This is a shortened example of what your signed client assertion JWT could look like:
    eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJtZXJjaGFudF9pZCIsInN1YiI6ImNsaWVudF9pZCJ9.XYabc123...
  7. Set the
    client_assertion
    request parameter in the access token request to the JWT string value.
    client_assertion={signed_jwt}
    This is an example of the client assertion in a complete access token request:
    POST https://api.cybersource.com/oauth2/v4/token Content-Type: application/x-www-form-urlencoded grant_type=client_credentials &client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer &
    client_assertion={signed_jwt}