On This Page
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:- Create a JWT header using these header fields:JWT Header FieldsHeader FieldDescriptionalgThe asymmetric algorithm you use to sign the token header. These algorithms are supported:
- RS256 (default)
- RS384
- RS512
- PS256
- PS384
- PS512
kidThe 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.typThe token type. Set toJWT.{ "alg": "RS256", "kid": "your_p12_key_id", "typ": "JWT" } - Construct the JWT payload as a JSON object that contains these required body claims:JWT Body Claim FieldsBody Claim FieldDescriptionaudSet to theCybersourcetoken endpoint. This is the audience of the JWT.expThe expiration time, in Unix epoch seconds. Keep the amount of time the token is valid short.iatThe time at which the token is issued in Unix epoch seconds.issThe 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.
jtiA unique JWT identifier, such as a UUID. This value must be unique for each request to help prevent replay attacks.scopeThe scopes requested by your application. Set to one of these possible values:- For embedded components, set toboarding.
- For remote MCP direct access, set totransaction_search user_management.
subSubject of the JWT. Set to your application's client ID, which is theclient_idvalue.v-c-merchant-idThe 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-kidThe 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" } - Encode the JWT header and payload using Base64URL.{base64url_encoded_header}{base64url_encoded_payload}
- Create the signing input by combining the encoded header and encoded payload.{base64url_encoded_header}.{base64url_encoded_payload}
- 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}
- 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...
- Set theclient_assertionrequest 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}