Token Schemas
  • 21 Nov 2022
  • Dark
    Light
  • PDF

Token Schemas

  • Dark
    Light
  • PDF

Article summary

Token requests are a good example of a translation you may want in two schemas (request and response). For instance, you may want to require fields on the request, but those fields are not present on the response.

Notice this schema does the translation from username to user_name and password to passwd on the request, and from access_token to token on the response.

Since the response schema does not have the dynamicfields flag, the default is false – which means that the only field that will show up in the response to IAP is token.

Example: Request Token Schema

  "$id": ”reqTokenSchema.json",
  "type": "object",
  "schema": "http://json-schema.org/draft-07/schema#",
  "translate": true,
  "dynamicfields": true,
  "properties": {
    "ph_request_type": {
      "type": "string",
      "description": "type of request (internal to adapter)",
      "default": "getToken",
      "enum": [
        "getToken",
        "healthcheck"
      ],
      "external_name": "ph_request_type"
    },
    "username": {
      "type": "string",
      "description": "username to log in with",
      "external_name": "user_name"
    },
    "password": {
      "type": "string",
      "description": "password to log in with",
      "external_name": "passwd"
    }
  },
  "required": ["username","password"],
  "definitions": {}



Example: Response Token Schema

  "$id": ”respTokenSchema.json",
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "translate": true,
  "properties": {
    "ph_request_type": {
      "type": "string",
      "description": "type of request (internal to adapter)",
      "default": "getToken",
      "enum": [
        "getToken"
      ],
      "external_name": "ph_request_type"
    },
    "token": {
      "type": "string",
      "description": "the token returned from system",
      "external_name": "access_token"
    }
  },
  "definitions": {}

Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.