{
  "type": "object",
  "additionalProperties": true,
  "properties": {
    "instanceid": {
      "type": "string",
      "minLength": 1
    },
    "uaa": {
      "type": "object",
      "properties": {
        "clientid": {
          "type": "string",
          "minLength": 1
        },
        "url": {
          "type": "string",
          "minLength": 1,
          "format": "absolute-uri"
        }
      },
      "required": [
        "clientid",
        "url"
      ]
    },
    "grant_type": {
      "type": "string",
      "enum": [
        "user_token", "client_credentials", "mtls"
      ]
    }

  },
  "if": {
    "properties": {
      "grant_type": { "const": "mtls" }
    },
    "required": ["grant_type"]
  },
  "then": {},
  "else": {
    "required": ["uaa"]
  }
}
