To give your customers access to the Voxpopme portal without them needing to authenticate with a set of credentials, you can generate an SSO link that will automatically authenticate and log a person into their Voxpopme portal.
|
SSO links have a limited lifetime, so make sure you generate them at the point of transferring the user to the Voxpopme portal. |
Generating an SSO Login Link
When generating an SSO link, you are given a few options to control the behaviour of the SSO link, including limiting the scope of access:
unique_idis an ID that you know to be unique that can be reused for subsequent SSO requests for the same user (this might be your own ID for the user).access_all_projectsis a boolean (you can use 0 or 1) to specify whether the SSO user will have access to all projects in the specified account.questionsis an array of project IDs that the SSO user has access to if you choose to control exactly which Projects the user has access to. Example -questions[]=12345
Re-generating SSO links for the sameunique_idwill append the new Project IDs to the ones specified in previous calls to this endpoint. This allows you to control and grow the list of Projects a user has access to. Ifaccess_all_projectsis set, this parameter is ignored.reset_accessis a boolean (you can use 0 or 1) that specifies whether the Project IDs specified inquestionsshould completely replace any Project IDs set in previous calls to this endpoint.pathis the path on the Voxpopme portal that SSO users will be directed to once they have been logged in, this can be a Project page, or a single Response view. The response body will provide a login URL that the user can be redirected to.
const formData = new FormData();
formData.append('unique_id', '192186');
formData.append('access_all_projects', '1');
formData.append('path', '/portal/project/54421/responses');
fetch('https://developer.voxpopme.com/v2/user/sso', {
method: 'POST',
headers: {
'x-api-key': 'your_api_key',
'account-id': 'your_account_id',
},
body: formData
});
Calling above will return a login URL which the user should be redirected to, to be authenticated with the parameters and permissions supplied in the SSO link generation endpoint.
{
'login_url' => 'https://www.voxpopme.com/user/sso?token=VayR01Fg0Jf...'
}
Comments
0 comments
Article is closed for comments.