Authentication
  • 03 Apr 2024
  • 1 Minute to read
  • Dark
    Light

Authentication

  • Dark
    Light

Article Summary

Introduction to authentication

Access tokens are requested from a separate authentication API and are obtained by authorization and authentication:

  • Authorization is the process of verifying that you have access to the resource that you are requesting, in this case, the Payments Hub API.

  • Authentication is the process of verifying your identity.

These steps are needed to ensure that only approved applications can access an API, and that they can only access the resources they are permitted to access.

When requesting an access token for the Payments Hub API, you send a JWT Bearer token as part of a request to the Oauth API. The JWT Bearer token is used by the Oauth API to verify your identity and, based on this information, the API confirms whether you are allowed to access the Payments Hub API. If the authorization and authentication steps are successful, the Oauth API provides you with an access token to use in Payments Hub API requests.

The following figure shows the authentication process for the Payments Hub API, where a client application requests an access token from the Oauth API and uses it in a request to the Payments Hub API.

authentication-process_01

Figure: Payments Hub API authentication process

Prerequisites

Before obtaining the access token, make sure you have a public-private key pair that you can use to sign JWT Bearer tokens.

Public key

To email your public key, along with the kid and iss claim values you will use in your JWT Bearer tokens, click here.

Note

  • The public key must be created with RSA and sent in PEM format, without password encryption, and must have a length of at least 2048 bits. If these criteria are not met, the token will be rejected.

  • If you don't have a public-private key pair yet, you can use a predefined JWT Bearer token in the sandbox with no need to create or sign your own tokens for authentication:

    eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6InByb1BheW1lbnRzSHViU2IifQ.eyJzdWIiOiJxTWtaOTBxb0hBTjVJbkE2V2xNYVZBaE41dDhBQWVPeCIsImlzcyI6IlNhbnRhbmRlciIsImlhdCI6MTcxMDg0MjgwNCwibmJmIjoxNzEwODQyODA0LCJleHAiOjE3NDIzNzg4MDQsImp0aSI6ImM3YWY0Yzg0LTRkYzQtNDM2Mi05OTA2LWM5ZTg5N2YyNzUzOCJ9.LOaGmVUnQ6I0HYUQWA1y2vUhREaJrAasAxDlqAnxKbEYGmjP6AKeIViLdkBVVPTUWRETxmnlU6fBQRYU0BN8NEJ9dd_uJ20uiPGWp1ieTFvee27LbqqqS-4AbwD_oJluBUzb77cx4P_1o35gFskcFjbzdl5ert4xJvpbXNOQYa0C7f4YQ6wMLjCGkbdhimwRxeOEGVdYiRoVEizkPpNgUZi_H3o58gATIJ4rSSWqLmKvy9aBlK_YAT947klkJI-ej22KU8qgLCInBbBGdoW9gjg8Zpmizs7Xc7eAvNm7QRiAzd1NT6dgX3hAYDJz2m2dnZYS6zE_UPWOi5cbAyQggw


Was this article helpful?