Using Management API mechanism for SSO is extremely simple. Just use your API credentials and sso-token
received from the browser to perform a simple HTTP POST request to the Trivore Identity Service server and you will be receive all user details as JSON response. The URL for consuming the sso-token
is https://<tis-hostname>/api/rest/v1/sso/token/<sso-token>
. The response from this REST endpoint is identical to retrieving user information via the normal user endpoint located at https://<tis-hostname>/api/rest/v1/user/<userId>
.
...
Example request for consuming sso-token
Code Block |
---|
breakoutMode | wide |
---|
language | bash |
---|
|
curl -i -X POST -H 'Accept: application/json' --user '<clientId>:<clientSecret>' https://<tis-hostname>/api/rest/v1/sso/token/<sso-token> |
Code Block |
---|
|
language | js |
title |
Example response from SSO token endpoint
Code Block |
---|
|
{
"email":"john.smith@example.com",
"emailVerified":false,
"id":"58cfb7353874e103fc81ec5f",
"locale":"en_GB",
"locked":false,
"meta":{
"created":"2017-03-20T11:04:21.534Z",
"lastModified":"2018-09-21T06:29:05.708Z",
"location":"https://<tis-hostname>/api/rest/v1/sso/token/<sso-token>"
},
"mfaMethod":"NONE",
"mobile":"+358401234567",
"mobileVerified":true,
"name":{
"familyName":"Smith",
"givenName":"John"
},
"nsCode":"test",
"orgCode":"test",
"preferredLanguage":"en_GB",
"username":"john.smith"
} |