The next step is to generate your client assertion. Sign the token in your own application code with any library that supports RS256. Step 3 below includes an example. For quick sandbox testing only, you can use an online JWT tool such as Dinochiesa JWT.
Never paste a production private key into a website. Anyone who obtains your private key can request tokens for your institution.

Step 1: Create the JWT header

Use this JSON as the decoded header:
This tells the signer to use RSA with SHA-256 and identifies the token as a JWT.

Step 2: Create the JWT payload

Use this JSON as the decoded payload and replace the placeholders with your own values:
Company Url: Your company URL. OAuth Institution Client ID: The client ID you copied from your Cardcore dashboard. Cardcore Environment: This is https://card-core-api.sudoafrica.site for production and https://card-core-api-sandbox.sudoafrica.site for sandbox. Issued At: This is the timestamp of the date you create the client assertion JWT. You can generate a timestamp using Epoch Converter. Expiry: This is the timestamp of the date you want the client assertion JWT to expire. Dinochiesa flow Note: iat and exp must be numbers (Unix timestamps in seconds), not strings. For example: 1639806203.

Step 3: Sign the token with your private key

Sign the header and payload with RS256 by using the private key you generated when you created your app. The signed output is your client assertion. This Node.js example uses only the built-in crypto module:
For sandbox testing with Dinochiesa JWT, paste your sandbox private key into the Private Key section and leave the public key section empty.

Step 4: Exchange the assertion for an access token

After you generate the client assertion, send it to OAuth Token to create your access token.