On This Page
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:
- Log in to theBusiness Center:
- On the left navigation panel, choosePayment Configuration > Key Management.
- Click+ Generate keyon the Key Management page.
- Under REST APIs, chooseREST – Certificate, and then clickGenerate key.The Key Generation page appears.If you are using aportfolioaccount, 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. - ClickDownload keyafter reviewing the key details.
The Key Generation page appears. - (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.
- ClickDownload key
.
- Create a password for the certificate by entering one into theNew PasswordandConfirm Passwordfields. ClickGenerate key.
The.p12file 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:
- Open the command-line tool and navigate to the directory that contains the P12 certificate.
- Enter this command:openssl pkcs12 -in [certificate name] -nodes -nocerts -out [private key name]
- Enter the password for the certificate.You set this password when you created the P12 certificate in theBusiness 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:
- Go to the Developer Center's API Reference page:
- On the left navigation panel, click .
- Under Authentication and Sandbox Credentials, go to the Authentication Type drop-down menu and chooseJSON Web Token.
- Enter your organization ID in theOrganizationfield.
- Enter your Password in thePasswordfield.
- ClickBrowseand upload your p12 certificate from your desktop.
- Click Update Credentials.A confirmation message states that your credentials are successfully updated.A confirmation message states that your credentials are successfully updated.
- Go to the Developer Center's API Reference and navigate toPayments >.POSTProcess a Payment
- ClickSend.
A message confirms that your request was successful with the status code 201.
- Log in to theBusiness Center:
- On the left navigation panel, chooseTransaction Management > Transactions.
- 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.