Single Sign On
Single Sign-On allows you to securely log your users into your personally branded user portal ( https://[your-domain].voiceportals.net ) securely from your current website.
Information you will need:
- Token -- Your API token, used for everything else on the API as well
- Username -- The username of the user account you would like to log in via SSO
In order to log a user in via SSO, you need to have all of this information available to you. Then, you will generate a JWT token with username and sso_key inside the payload, encoded using your API token.
$token = 'your-api-token';
$sso_key = 'your-users-sso-key';
$username = 'your-users-username';
$jwt = array(
'username' => $username,
'sso_key' => $sso_key
$jwt = Firebase\JWT\JWT::encode($jwt, $token);
// prints something to the effect of: // ``` eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6InlvdS11c2Vycy11c2VybmFtZSIsInNzb19rZXkiOiJ5b3VyLXVzZXJzLXNzby1rZXkifQ.XdS2AAqCE5bQi6w59Rq0QUgrXC6ApjbFN0p-ZoMr-2c
It's that simple. You then take the $jwt variable and pop it into a URL: https://your-domain.voiceportals.net/sso/your-user-id/jwt-token
So, say your user id is 238, your domain is awesomevoip and your token is the one generated above, the URL would look like:
You now can give your users direct access into your white labeled user portal directly, without a log in screen. Cool, huh?