REST API – New features of user

We have improve REST API for User in Safewhere*Identify 5.0 to support many new features such as Act as service URI, multiple user contexts and multiple certificates. You can refer to https://github.com/Safewhere/Safewhere-Identify-samples for sample code.

Support Actas setting for User object:

The “Act as service URI” on the User details page

Is supported by REST API as

“actAsServiceUris”: [
   “string”
],

Support multiple User contexts:

From 5.0, a user has multiple contexts to determine the periods of time in which the user is active. When the user is used for Identify*STS’ certificate endpoint, a user context can also be used to specify if a user’s certificate is active. Below is an example for a user context in which:

  • Each context has an activation time and a certificate.
  • The user contexts must have separate certificates. The claim type and claim name are reserved for advanced use cases in a future version.

“userContexts”: [
   {
     “activationTime”: {
       “EndTime”: “2016-08-01T07:09:58.495Z”,
       “StartTime”: “2017-08-01T07:09:58.495Z”
     },
     “certificateThumbprint”: “9371CF06D75A6DACD61AED6F7D0802C95649F4B2″,
     “claimType”: “urn:claimType:1″,
     “claimValue”: “claimValue1″,
     “id”: “Id4e49af10-b259-4e84-aa3e-02fbed82cc7e”
   },
{
     “activationTime”: {
       “EndTime”: “2017-08-01T07:09:58.495Z”,
       “StartTime”: “2018-08-01T07:09:58.495Z”
     },
     “certificateThumbprint”: “another thumbprint”,
     “claimType”: “urn:claimType:2″,
     “claimValue”: “claimValue2″,
     “id”: “another id”
   }
],

Support multiple certificates

Since a user can have multiple certificates now, it is natural that User REST API has been extended to support multiple certificates. This means that the x509Certificates can support an array of certificates now:

“x509Certificates”: [
   “Base64-encoded raw data of certificate 1″,
   “Base64-encoded raw data of certificate 2″
],

Was this helpful ?Good Somewhat Bad