Callback Advanced Authentication allows you to secure the communication between and your customer's systems (end users) when the given profile is used for the callback using Advanced Authentication. The Advanced Authentication allows you to generate a token that can use for callback responses. Token-based authentication is an authentication protocol where you can verify's identity by pre-configured client ID and client secret through payload in exchange for a unique access token valid for a defined duration to call your callback endpoint.

You can successfully configure Advanced Authentication for your Callback Profile by updating the auth type, HTTP methods for calling authentication URL, authentication URL, client ID, client secret, other required path details, authentication algorithm, and eventually optional custom headers.

Once the Advanced Authentication is set by you, when has to send a callback to your system, first of all, an authentication request is sent to the configured authentication URL to receive the access token. The authentication request contains among others, the configured Client ID and Client Secret. In response, your authentication system shares the access token that can be in encrypted form and valid for a specific duration. then adds the same token in the subsequent callback calls sent to your callback URL.

Sample response from the customer containing a token

The following is the sample response from the customer containing a token:

"token_type": "Bearer",
"expires_in": "3599",
"ext_expires_in": "3599",
"expires_on": "1686632570",
"not_before": "1686628670",
"resource": "00000002-0000-0000-c000-000000000000",
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ikpva"

Sample request from after adding token shared by customer

The following is the sample request from after adding the token shared by the customer:

curl --location --request GET '' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6Ikpva'


The following is the benefit of using Advanced Authentication:

  • All callbacks will be authenticated towards the customer endpoint.

Supported Grant Types

The following is the list of supported and unsupported grant types:

OAuth Grant TypeSupportedNotes
Client CredentialsYes
Authorization CodeNoIt requires user interaction via a redirect URL. It is not supported.
Proof Key for Code Exchange (PKCE)NoAs an extension to the Authorization Code grant type. It is not supported.
Device AuthorizationNoIt requires user interaction via a redirect URL. It is not supported.
Refresh TokenNoIt is not supported.

You must contact the Kaleyra Support team to enable the Advanced Authentication option on your’s Settings page.

To add a Callback Profile with an Advanced Authentication option, perform the following steps:

  1. Follow Step 1 to Step 11 of the Callback Profiles.
  1. Click the Advanced Authentication toggle button.
    The Advanced Authentication detail appears.
  1. Enter the following details:
    1. Click the Select auth type dropdown to view the list of supported authentication types you want to use to validate the callback calls from Currently, supports Oauth 2.0.
    2. Click the Select HTTP Method dropdown to view a list of HTTP methods. Select the HTTP method type you want to send the Advanced Authentication. For example, POST.
    3. In the Auth URL field, enter the endpoint URL has to call to request the access token. For example, To generate the token Client ID and Client Secret details are required.
    4. In the Client ID field, enter the client ID that you want to use to generate the token. For example, MDXXXXTM3NXXXXDUXXXXm.
    5. In the Client Secret field, enter the client's secret that you want to use to generate the token. For example, UXXXXXXXXXXnN6eURNN2NtUg.
    6. In the tokenFieldPath field, enter the attribute name where you will send the token back in the authentication response.
    7. In the expirationFieldPath field, enter the attribute name where you send back in the response the validity time of the generated token.
    8. In the authAlgorithm field, enter the algorithm you will use to encode the token before sending it back to kaleyra in the authentication response. For example, RSxx6.
    9. (Optional) In the Headers field, enter any additional values as Key-Value pairs that you need for Advanced Authentication. These values are additional information that you may request to receive in the authentication request from to your authentication URL.
    10. (Optional) After you enter the first Key-Value pairs, to add more Key-Value pairs, click + Add More.
  2. Follow Step 12 and Step 13 of the Callback Profiles.