latestOpenAPI 3.0.32026-08-109359194.9 KB

112399a67ebb

Authentication

Generates an encrypted referstring for authentication

This endpoint will generate encrypted refer strings that can be used to authenticate users into an Unqork environment

Environment Variables - The following Environment Variables are required

  • key : key for encryption
  • cipher : method of encryption. The default and recommended cipher is aes-256-gcm.

Include this refer string in the link to an Unqork resource as follows

<hostname>?refer=<referString>/#/display/<resource_id>
  • hostname - host name of Unqork server
  • referString - referString returned from API
  • resource_id - Id of the Unqork resource to viewFor example, https://client.unqork.io?refer=<referString>/#/display/abcd123

Examples

Example 1: Generate Refer String for 1 day (default role)

Request

 {
   "userId": "user123",
   "expireOffset": 1,
   "expireMeasure": "days"
 }

Response

 {
   "referString": "<encrypted refer string>"
 }

Example 2: Generate Refer String for single use (recommended)

Request

 {
   "userId": "user123",
   "expireOffset": 1,
   "expireMeasure": "days",
   "oneTimeUse": true
 }

Response

 {
   "referString": "<encrypted refer string>"
 }

Example 3: Generate Refer String for custom role

Request

  {
    "userId": "user123",
    "expireOffset": 1,
    "expireMeasure": "days",
    "additionalParams": {
      "role": "customRole"
    }
  }

Response

  {
    "referString": "<encrypted refer string>"
  }

Example 4: Generate Refer String with custom user parameters

Request

  {
    "userId": "user123",
    "expireOffset": 1,
    "expireMeasure": "days",
    "additionalParams": {
      "custom1": "custom value 1",
      "custom1": "custom value 2",
      "custom1": "custom value 3"
    }
  }

Response

  {
    "referString": "<encrypted refer string>"
  }

Authorization Required:

  • Designer Administrator
post/referstring

Request body

userIdstring required

Unique ID of the user, as a string

expireOffsetinteger

Provides an amount of time until expiry, used in conjunction with the units from expireMeasure. Maximum offset 30 days or equivalent. Default offset 1 (default unit is hours).

expireMeasurestring

String with the units for the expireOffset parameter (e.g. hours, days). Maximum offset 8 days or equivalent. Default measure hours (Default offset is 1)

oneTimeUseboolean

Whether to limit the refer string to one use. For best security, it is recommended to set oneTimeUse to true.

additionalParamsobject

An object with anything else to be added to referstring

Response

Successful Generation

referStringstring required

The encrypted refer string containing user information