Table of Contents


AuthToken

Sometime for third party app or native mobile app integrations you may require to be able to create secure login token and be able to log a user into your Magentrix Portal. Using the below end-point you can obtain a one-time use Authentication Token and use this token to log a user in.

In order to obtain this token, first need to authenticate
Then using the <sid> or session ID, you can call this end point to obtain the Authentication Token, see below:

POST https://<your-portal-domain>/rest/2.0/authtoken
 -H "Authorization: Bearer <sid>"
 -H "Content-Type: application/json"
 -H "Accept: application/json"

Optionally you can also pass a parameter to increase the timeout of the token, token by default lasts for 1 minute.
Parameter name: timeoutInMinutes
 

The response would something like this:

{
   Token: "...."
}

 

Once, you have the Authentication Token, you can forward the user to portal login endpoint:

https://<your-portal-domain>/user/login?token=<Token>

After user has successfully logged in, they will be forwarded to their appropriate login flow or landing pages.

 

Note:  In order to get better results, please make sure the users have already signed in for the first time into the portal and set their account up.