Here is how to configure 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.
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.
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.