Authentication

post
Authentication with email and password

https://api.tiledesk.com/v1/auth/signin
Allows to authenticate an agent using email and password.
Request
Response
Request
Headers
Content-Type
required
string
use "application/json" value
Body Parameters
email
required
string
the user email address
password
required
string
the user password
Response
200: OK
{
"success":true,
"token":"JWT XYZ",
"user":{
"_id":"5ab11c6b83dc240014d46095",
"email":"andrea.leo@f21.it"
}

post
Signup with email and password

https://api.tiledesk.com/v1/auth/signup
Allows to signup an agent using email and password.
Request
Response
Request
Headers
Content-Type
required
string
use "application/json" value
Body Parameters
email
required
string
the user email address
password
required
string
the user password
firstname
required
string
the user firstname
lastname
required
string
the user lastname
Response
200: OK
{
"success":true,
"msg":"Successfully created new user.",
"user":{
"_id":"5e2593f0cf6bcc00178e75f7",
"email":"andrea.leo@f22.it",
"emailverified":false,
"createdAt":"2020-01-20T11:50:08.778Z",
"updatedAt":"2020-01-20T11:50:08.778Z",
"__v":0
}
}

post
Anonymous authentication for a user.

YOUR_TILEDESK_DOMAIN/auth/signinAnonymously
Allows a user to authenticate anonymously on the system. Only works for Tiledesk v2 environment (on-premises only).
Request
Response
Request
Headers
Content-Type
required
string
use "application/json" value
Body Parameters
id_project
required
string
the project to which the user belongs
firstname
optional
string
the user firstname
lastname
optional
string
the user password
email
optional
string
the user email
attributes
optional
object
the user custom attributes
Response
200: OK
{
"success":true,
"token":"JWT XYZ",
"user":{
"_id":"5e25944ecf6bcc00178e75fa",
"email":"a0fe493b-a19b-44a0-99ce-414c65fc20b0@tiledesk.com",
"emailverified":false,
"createdAt":"2020-01-20T11:51:42.115Z",
"updatedAt":"2020-01-20T11:51:42.115Z",
"__v":0
}
}

post
Custom authentication for a user.

YOUR_TILEDESK_DOMAIN/auth/signinWithCustomToken
Allows to authenticate with a custom JWT token. Only works for Tiledesk v2 environment (on-premises only).
Request
Response
Request
Headers
Authorization
required
string
Custom JWT Authorization token. See below
Content-Type
required
string
use "application/json" value
Response
200: OK
{
...
}

Overview

The Custom JWT authentication provider allows users to authenticate with an authentication system that is independent from Tiledesk. The external system must return a signed JSON Web Token that contains a unique ID value for the authenticated user.

Tiledesk uses the JWT to identify your application’s users and authenticate their requests but does not impose any restrictions on the external authentication system’s requirements or authentication methods.

You must set the following required fields of the user object :

  • _id is the custom unique user identifier of the external authentication system.

  • subject. JWTs describe their subject in the sub claim. sub must be equal to value userexternal

  • audience. JWTs describe their audience in the aud claim. Must be https://tiledesk.com/projects/<YOUR_PROJECT_ID>.

Optional fields:

  • firstname. It's the user firstname

  • lastname. It's the user lastname

  • other jwt claims.

The external authentication system must create the JWT signing the user object with the project authentication secret code. See here to obtain a Project JWT Secret: https://developer.tiledesk.com/widget/auth#generating-a-chat-shared-secret

User object example:

{_id: "123", firstname:"andrea", lastname:"leo", email: "email2@email.com", customAttr: "c1", sub: "userexternal", aud: "https://tiledesk.com/projects/5c81593adf767b0017d1aa68'}