You can authenticate your users using the following methods:Documentation Index
Fetch the complete documentation index at: https://docs.typingmind.com/llms.txt
Use this file to discover all available pages before exploring further.
- Email login (default)
- Single Sign-On
- External Authentication (JWT)
Overview
External Authentication via JWT allow you to authenticate your user using a JWT token. Your user will have a unique link like this:https://chat.yourcompany.com?externalAuthCode=XXXXXX
When visiting the link, the user will be logged in automatically.
This will help you integrate Typing Mind Custom better with other system you may have in your company.
Use cases:
- Authenticate users when using Typing Mind Custom as a web widget, so you know who is chatting.
- Skip the signup/login flow for your users.
- Use the user identity from another existing system you already have in your company (Note: if you are looking for SSO, check out Single Sign-On page).
- Create a quick login link from other systems in your company.
Step 1: Enable External Authentication and get a JWT secret
Go to Admin Panel → User Authentication → JWT and enable it. (If you don’t find this in your admin panel, please contact us to enable this feature for you). Once enabled, you will be provided with a JWT secret. This JWT secret is used to sign the JWT token (externalAuthCode).
Step 2: Create externalAuthCode
The externalAuthCode is the JWT token signed with your secret. The payload must follow the following structure in order to authenticate your users.
Authenticate an existing user
The payload must contain aid field (user ID) or email field of the existing user. If both id and email is provided, the system will prioritize using id.
The user ID can be retrieved from our API.
Example 1: authenticate an existing user by email
Create a new user
The payload must contain auser object with an id property (string). For example:
Step 3: Use externalAuthCode in URL or via Widget
You can now add the externalAuthCode to the instance URL as follow:
data-external-auth-code attribute like follow:
Some facts:
- The
user.id(user ID) field must be unique across all users of your chat instance. This will be used to identify the user. - If the user ID does not exists in the first time the
externalAuthCodeis used, the system will create a new user with that ID. This will take up the seats count of your instance, so make sure you have enough seats count, otherwise the user will see an error page. - You can see the list of users created via
externalAuthCodein the Admin Panel just like any other users.