Custom Token Implementation
Log in for your RMS, the simple way
Get your Private Token API key.
Please contact your account manager to get your Private Token API. You will find more information in the Private Token API section.
You are responsible for keeping the key secure and private.. Never use the Private Token key in Front-end code or pushed in a public repository.
Get a user token to auto-connect them.
Call the Rezi API below with the information required. The private key will be sent to the API; call the API only from your back-end or micro-service. Calling this API directly from Front-end will publicly reveal your private key.
The user token is valid for less than 1 hour. After you get the User Token, auto-connect your user.
Get a User Token
POST
https://open-api.rezi.ai/v1/user/token
This endpoint allows you to get a token to auto-connect your user by sharing user credential.
Headers
Content-type*
string
"application/json"
Authentication*
string
"Bearer PRIVATE_TOKEN_API_KEY" Authentication token to secure and track down your usage. Use this specific format with your Private API key
Request Body
uid*
string
Password of the user your want to connect. You can hash from your side before sending to API.
email*
string
Email of the user your want to connect.
{
"status": "success",
"userID": "abcdefg",
"token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJodHRwczovL2lkZW50aXR5dG9vbGtpdC5nb29nbGVhcGlzLmNvbS9nb29nbGUuaWRlbnRpdHkuaWRlbnRpdHl0b29sa2l0LnYxLklkZW50aXR5VG9vbGtpdCIsImlhdCI6MTYyOTM2MTU5MywiZXhwIjoxNjI5MzY1MTkzLCJpc3MiOiJmaXJlYmFzZS1hZG1pbnNkay1wNmFyekByZXppLWRldmVsb3AuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJzdWIiOiJmaXJlYmFzZS1hZG1pbnNkay1wNmFyekByZXppLWRldmVsb3AuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJ1aWQiOiJ5ZGtzU1hEVTFQWjVoaHVOZENWbCJ9.TtMwURv2p_c2wm0MTVA1EmJQs_eXcg3KjINWs3SgGQHian2jp7zVSlN16fhf5IbyD9VWhujyG4738IjfjDnqW7EXrKRatm4QWGstCx6t1G2u86YObuJIaqzt09-IC_gVKLN4t4wJ5AHbACC1HjOf9t_Htd4ce8U7tdFqUtA_taR1BH6VQ0gISba8LICwXk6EC1vvwS3qPB202GCr4KAlyLnHLOmI6Xh93BghBtab2Do-_tpMVeu2NlCBlw0KCgsP2llpvqAALrqKyReyNb3ESPUGqsrNBS8Zi6gQnOuq-5VlVP08E9_YfswNPDRNHhKXYNn4IrRND62WWRchjys2AQ"
}
If first time for this user to connect, creation of user can take around 2 seconds.
UID associated to email should be all time the same. Password hashed as UID is a secure way to connect your user to our system.
Signup/Login with the user token
1/ You will need to get a Private Token Key check the Private Token API section.
2/ Call the Open api Post /user/token to receive a USER_TOKEN to connect your user
Get a User Token
POST
https://open-api.rezi.ai/v1/user/token
This endpoint allows you to get a token to auto-connect your user by sharing user credential.
Headers
Content-type*
string
"application/json"
Authentication*
string
"Bearer PRIVATE_TOKEN_API_KEY" Authentication token to secure and track down your usage. Use this specific format with your Private API key
Request Body
uid*
string
Password of the user your want to connect. You can hash from your side before sending to API.
email*
string
Email of the user your want to connect.
{
"status": "success",
"userID": "abcdefg",
"token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJodHRwczovL2lkZW50aXR5dG9vbGtpdC5nb29nbGVhcGlzLmNvbS9nb29nbGUuaWRlbnRpdHkuaWRlbnRpdHl0b29sa2l0LnYxLklkZW50aXR5VG9vbGtpdCIsImlhdCI6MTYyOTM2MTU5MywiZXhwIjoxNjI5MzY1MTkzLCJpc3MiOiJmaXJlYmFzZS1hZG1pbnNkay1wNmFyekByZXppLWRldmVsb3AuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJzdWIiOiJmaXJlYmFzZS1hZG1pbnNkay1wNmFyekByZXppLWRldmVsb3AuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJ1aWQiOiJ5ZGtzU1hEVTFQWjVoaHVOZENWbCJ9.TtMwURv2p_c2wm0MTVA1EmJQs_eXcg3KjINWs3SgGQHian2jp7zVSlN16fhf5IbyD9VWhujyG4738IjfjDnqW7EXrKRatm4QWGstCx6t1G2u86YObuJIaqzt09-IC_gVKLN4t4wJ5AHbACC1HjOf9t_Htd4ce8U7tdFqUtA_taR1BH6VQ0gISba8LICwXk6EC1vvwS3qPB202GCr4KAlyLnHLOmI6Xh93BghBtab2Do-_tpMVeu2NlCBlw0KCgsP2llpvqAALrqKyReyNb3ESPUGqsrNBS8Zi6gQnOuq-5VlVP08E9_YfswNPDRNHhKXYNn4IrRND62WWRchjys2AQ}
Call example:
curl --location --request POST 'https://open-api.rezi.ai/v1/user/token'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer PRIVATE_TOKEN_API'
--data-raw '{ "email": "user_email@gmail.com", "uid": "12345678910" }'
Response example:
{
"status": "success",
"token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJodHRwczovL2lkZW50aXR5dG9vbGtpdC5nb29nbGVhcGlzLmNvbS9nb29nbGUuaWRlbnRpdHkuaWRlbnRpdHl0b29sa2l0LnYxLklkZW50aXR5VG9vbGtpdCIsImlhdCI6MTY2MTgzOTk2OCwiZXhwIjoxNjYxODQzNTY4LCJpc3MiOiJyZXppLTNmMjY4QGFwcHNwb3QuZ3NlcnZpY2VhY2NvdW50LmNvbSIsInN1YiI6InJlemktM2YyNjhAYXBwc3BvdC5nc2VydmljZWFjY291bnQuY29tIiwidWlkIjoib0xYNFFCdm9PZTA0RE1uTzFGUUQifQ.VPCY_bjo8kNj8x1IOdMbHSvRuGB4yjfJjDudQ9m1A2AIoIRmFqFpl4P6ZCFaFqmYRx08jw2NH3JAMrlLmsc1XNjkWzOupgYqOYYU71f9ulalHL-h4Enb6RLm72iIQA8WbOhBNAiMi6khCHX-102wRhY0fS0vLVYUfrkUH3u2V3TP42lE1HpusxUlWs0FDp7pVqI7XmQydFFTI3CXOBUXftM1rPsqanqJw2U6SVCLz_iv9U8QhDmJMiel1PQO6a8Qt1nomwSMNpjRR2_63kouUQGeAw5vzoJwe85aYa7LsrsKu_nxh8vmos_XoR5R3Dr848rXnc5BNyX_UIXUh7CkZw"
}
3/ You can connect your user to your RMS by passing, the user token (USER_TOKEN ) directly in the URL.
https://app.myAwesomeRms.com/login/?token=USER_TOKEN
The options list for the login URL
Each option can be added from the base URL https://app.myAwesomeRms.com/login/?key=value&key2=value2&key3=value3
token
USER_TOKEN
Required
openOnboarding
true or false, by default onboardin is not openning
Optional
closeOnboardingRedirect
an internal link for example: /dashboard/education
Optional
A full example will be:
https://app.myAwesomeRms.com/login/?token=USER_TOKEN&openOnboarding=true&closeOnboardingRedirect=/dashboard/education
In this example, the user will be login, the onboarding will open right away and if the user decides to close the onboarding, it will be redirected to the best practices page.
Last updated