FILTER BY TAG
Limited Availability

Client Authentication Setup

You must set up secure client authentication in order for
Cybersource
to verify your application when it requests access tokens. To set up client authentication, you must create a P12 certificate, which contains a public and private key. You can then extract the private key and use it to sign every JWT you construct in order to request access tokens. Access tokens enable your platform or application to act on-behalf of merchants. This section describes how to create a P12 certificate and extract its private key.

Step 1A: Create a P12 Certificate

Follow these steps to create a P12 certificate:
  1. On the left navigation panel, choose
    Payment Configuration > Key Management
    .
  2. Click
    + Generate key
    on the Key Management page.
  3. Under REST APIs, choose
    REST – Certificate
    , and then click
    Generate key
    .
    The Key Generation page appears.
    If you are using a
    portfolio
    account, the Key options window appears, giving you the choice to create a meta key.
    For more information about how to create a meta key, see .
    The Confirmation Key Generation window appears.
  4. Click
    Download key
    after reviewing the key details.
    The Key Generation page appears.
  5. (Optional) You can set the Certificate Expiry Timeframe field to the number of months you want the key to remain active before it expires. Only whole numbers from 1–36 are accepted. By default, new keys expire after 12 months.
  6. Click
    Download key
    .
  7. Create a password for the certificate by entering one into the
    New Password
    and
    Confirm Password
    fields. Click
    Generate key
    .
    The
    .p12
    file downloads to your desktop.
    If prompted by your system, approve the location to which the key downloads.

Step 1B: Extract the Private Key

When you have your P12 certificate, extract the private key from the certificate. Use this key to sign your header when sending an API request.
Prerequisite
You must have a tool such as OpenSSL installed on your system.
Extract the Private Key
Follow these steps to extract the private key using OpenSSL:
  1. Open the command-line tool and navigate to the directory that contains the P12 certificate.
  2. Enter this command:
    openssl pkcs12 -in [certificate name] -nodes -nocerts -out [private key name]
  3. Enter the password for the certificate.
    You set this password when you created the P12 certificate in the
    Business Center
    .
The new certificate is added to the directory with the private key name you supplied in Step 2.

Step 1C: Testing Your Private Key

Follow these steps to verify that your P12 certificate is valid:
  1. On the left navigation panel, click .
  2. Under Authentication and Sandbox Credentials, go to the Authentication Type drop-down menu and choose
    JSON Web Token
    .
  3. Enter your organization ID in the
    Organization
    field.
  4. Enter your Password in the
    Password
    field.
  5. Click
    Browse
    and upload your p12 certificate from your desktop.
  6. Click Update Credentials.A confirmation message states that your credentials are successfully updated.
    A confirmation message states that your credentials are successfully updated.
  7. Go to the Developer Center's API Reference and navigate to
    Payments >
    POST
    Process a Payment
    .
  8. Click
    Send
    .
    A message confirms that your request was successful with the status code 201.
  9. Log in to the
    Business Center
    :
  10. On the left navigation panel, choose
    Transaction Management > Transactions
    .
  11. Under Search Results, verify that the request ID from the test authorization response is listed in the Request ID column.
    If the test authorization was successful, a success message is present in the corresponding Applications column.