Custom Authentication

Custom Authentication

Here is how to configure Custom Authentication.

What is Custom Authentication?

Custom Authentication is a feature that enables Single Sign-On (SSO).

This allows users to be automatically logged into the tripla chatbot when they are already logged into your website or application. It links your site/app login with the chatbot login.

When the chatbot is launched, a token is passed in the code calling the chatbot. The chatbot then uses that token to call a User Info Web API provided by your system to retrieve user information.

If the user information is successfully retrieved, the chatbot opens in a state where the user is automatically logged in with that data.


How to Set Up Custom Authentication for the Chatbot:

1. Set the User Info API
On the custom authentication settings screen in the tripla admin, set the Web API URL that the chatbot should call to retrieve user info from your system or app.

2. Add the data-user-token parameter to the chatbot code
When calling the chatbot from your website or app, add the data-user-token parameter to the chatbot script.
This token value must be generated by your service.

The chatbot will substitute this data-user-token into the {{client_token}} field of the User Info API you set earlier, and call it.

Note: The token used in data-user-token must be in JWT (JSON Web Token) format.

example:

Normal ver. <script async src="https://tripla.jp/sdk/javascript/tripla.min.js" data-triplabot-code="60xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx51"> </script>

example with custom token:

<script async src="https://tripla.jp/sdk/javascript/tripla.min.js" data-triplabot-code="60xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx51" data-user-token="eyXXXXXXXXXXXXXXXXVCJ9.eyXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c”> </script>

From the facility management screen, go to [Settings] → [Custom Authentication].

When you turn on Custom Authentication, a popup like the one below will appear.

Please fill in the fields according to the table shown.

If a user is logged into the app, and the chatbot opens using that user's token received from the partner app, there may be security concerns if the token is directly used to identify the tripla chatbot user.

To address this, the chatbot will call the customer's server using the token along with the secret key configured in the Concierge Manager.


Secret Key
Enter the secret key used to encrypt/decrypt the JWT user token.
If not set, the token received via client-user-token will be passed as-is as the value of {{client_token}}.
If you do not have a secret key, this field can be left empty.

User Info API

  • GET/POST: Select GET.

  • Enter the partner API (Customer info API) endpoint URL.

Header
If the User Info API receives the token in the header, specify the header parameter name here.
The value of {{client_token}} will be passed as the token.

Parameter
If the User Info API receives the token via URL parameters, specify the parameter name and use {{client_token}} as its value.

Map response data to user attributes

  • user_name: Set the parameter name that returns the user’s name from the API response.

  • user_email: Set the parameter name that returns the user’s email from the API response.

  • uid: Set the parameter name that returns the user ID from the API response. This ID will be uniquely linked to the tripla chatbot user ID.

Example:

Once the configuration is complete, the screen will update as shown in the image below.

This completes the custom authentication setup.

Custom Authentication for the Booking Widget

From the brand management screen, select [Admin Settings].

Then, select [Custom Authentication].

​When you turn Custom Authentication ON, a pop-up window like the one below will appear.

Please fill in the required fields according to the instructions in the form.


Parameter Name for client_token in the URL

Set the URL parameter name used to pass the client_token. This parameter will be used in combination with the booking widget URL parameters.


User Information API

  • Method: Select POST.

  • Customer Info API URL: Enter the endpoint URL of the partner’s user information API.


Header

  • content-type: Only application/soap+xml is supported.


Body

If the User Information API receives the token in the request body, specify the element name and use {{client_token}} as its value.


Map Response Data to User Attributes

  • uid: Set the element name containing the user ID in the API response. This ID will be uniquely linked to the tripla Booking Widget member ID.


Once the settings are completed, the screen will update to reflect the enabled status, as shown in the example below.

This completes the custom authentication setup.

    • Related Articles

    • Custom Bot

      With the Info Bot, you can ask guests questions in a chat-style format based on the steps you've created. You can configure settings to provide different responses based on YES/NO answers, send API requests, or return users to a specific step if no ...
    • Custom Email Domain

      Here is how to configure a Custom Email Domain: By default, reservation-related emails are sent from mail@tripla.jp. However, with this feature enabled, you can send emails using your property’s own domain (email address). Note: Only one email ...
    • Delete custom account

      If you have an existing membership system integrated with tripla, you can set up instructions to inform users how to properly delete their accounts from your system. You can configure the [Custom Account Deletion] instructions. When this feature is ...
    • Custom Email Templates

      Customizing Email Templates for Customers This guide explains how to customize email texts sent to customers. From the property management screen, select [Reservation Engine Settings] → [Custom Email Templates]. The email subject and body settings ...
    • Outgoing Webhooks

      By setting up Outgoing Webhooks, you can send notifications to an external service whenever a specified action occurs. What is a Webhook? A webhook is a mechanism that allows you to call functions on external services via the internet using ...