If your white label system allows it, you can log your users into their account by using an API token generated in their account.
A user can create an API token by visiting their Profile and then choosing API from the menu.
Your users must be informed that they need to protect their API key in the same way they would protect their password. If you are storing an API key in your own system, please ensure that it is stored safely.
Initiating a login
Send a POST
request from the user’s browser to:
https://yourwhitelabel.com/api/login
Headers
Header | Value | Description |
---|---|---|
Accept | application/json | Forces the application to return a JSON response on error, rather than redirect the user to the login screen |
Parameters
Parameter | Value | Description |
---|---|---|
api_token | {users api token} | A plaintext string containing the user’s API token |
If the login attempt is successful, you will receive a JSON formatted string as follows:
{
"authenticated": "true"
}
An unsuccessful response will return the following
{
"error": "Unauthenticated."
}
Redirecting after login
After successfully authenticating a user, you can redirect them to the relevant page on the white label system. We would recommend either:
- /profiles
- /calendar
Force show the login form
If you’re an administrator you might want to login with a traditional username and password. Read more: