{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/nthu/main/json-schema/nthu-identity-resource-schema.json",
  "title": "IdentityResource",
  "description": "Fields returned by /resource.php. Which fields appear depends on the scopes the data-owning unit approved for the client under the OAuth service management policy.",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nthu-oauth-api-openapi.yml#/components/schemas/IdentityResource",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Whether authentication succeeded."
    },
    "userid": {
      "type": "string",
      "description": "NTHU account identifier."
    },
    "otp": {
      "type": "boolean",
      "description": "Whether the account has one-time-password enabled."
    },
    "inschool": {
      "type": "boolean",
      "description": "True for currently employed, enrolled or reinstated accounts; false for departed, graduated, withdrawn or visiting-student accounts."
    },
    "name": {
      "type": "string",
      "description": "Chinese name."
    },
    "name_en": {
      "type": "string",
      "description": "English name."
    },
    "email": {
      "type": "string",
      "format": "email"
    },
    "lmsid": {
      "type": "string",
      "description": "Learning-management-platform account identifier."
    },
    "cid": {
      "type": "string",
      "description": "National identification number. Personally identifiable; release is gated on approval by the data-owning unit under Taiwan's Personal Data Protection Act."
    }
  }
}