すべてのプロダクト
Search
ドキュメントセンター

Identity as a Service:OIDC ID トークンの拡張フィールドの値のルール

最終更新日:Jun 26, 2025

このトピックでは、拡張 OpenID Connect(OIDC)id_token フィールドの値のルールについて説明し、構成例を示します。

id_token 拡張フィールドへの入力ルール

種類

説明

変数

user.username

ユーザー名。

user.displayName

表示名。

user.phone (期限切れ)

国別コードを含まない、期限切れの携帯電話番号。

user.phoneNumber

国別コードを除く携帯電話番号。

user.email

メールアドレス。

user.status

ユーザーのステータス。有効な値:

  • enabled

  • disabled

user.primaryOrganizationalUnitId

ユーザーが所属するプライマリ組織の ID。

user.organizationalUnits

ユーザーが所属する組織の情報。

ArrayMap(user.organizationalUnits, __item.organizationalUnitId)

ユーザーが所属するすべての組織の ID。

値は JSON 配列です。

user.groups

アカウントが所属するグループの情報。

値は JSON 配列です。

ArrayMap(user.groups, __item.groupId)

アカウントが所属するグループの ID。

値は JSON 配列です。

ArrayMap(user.groups, __item.groupExternalId)

アカウントが所属するグループの外部 ID。

値は JSON 配列です。

user.customFields

すべての拡張フィールドに関する情報。

値は JSON 配列です。

user.customFieldMap.$fieldname$.fieldValue

拡張フィールドの値。

定数

定数は二重引用符("")で囲みます。

高度な機能。式を使用して、値を柔軟に連結および変更できます。

詳細については、「アカウントフィールドの高度な式」をご参照ください。

例:user オブジェクト。

{
  ...
  "customFieldMap": {
        "place": {
            "fieldName": "place",
            "fieldValue": "beijing" // 場所
        },
        "age": { // 年齢
            "fieldName": "age",
            "fieldValue": "18"
        }
    },
    "identityProviderUserMap": {
        "idp_m2gngriuenktdkxxxxxx": {
            "identityProviderId": "idp_m2gngriuenktdkxxxxxx",
            "identityProviderType": "ding_talk",
            "identityProviderExternalId": "corp_1234xxxxxxx",
            "identityProviderUserId": "b2ed5fc0xxxxx"
        }
    },
    "organizationalUnits": [ // 組織単位
        {
            "organizationalUnitId": "ou_sdfadtaaxxxxxx",
            "organizationalUnitName": "AD",
            "primary": false
        },
        {
            "organizationalUnitId": "ou_werttxxxxxx",
            "organizationalUnitName": "name_002",
            "primary": true
        }
    ],
    "primaryOrganizationalUnitId": "ou_werttxxxxxx", // プライマリ組織単位ID
    "customFields": [ // カスタムフィールド
        {
            "fieldName": "place", // 場所
            "fieldValue": "beijing"
        },
        {
            "fieldName": "age", // 年齢
            "fieldValue": "18"
        }
    ],
    "groups": [ // グループ
        {
            "groupId": "group_jp6al4sn4n4wjgjxxxxxx",
            "groupName": "group1",
            "groupExternalId": "group_jp6al4sn4n4wjgjxxxxxx"
        },
        {
            "groupId": "group_vavikcxewkf5h3oxxxxxx",
            "groupName": "group2",
            "groupExternalId": "group_vavikcxewkf5h3oxxxxxx"
        }
    ],
  ...
}

OIDC 式の例

image

  1. id_token の organizationalUnits フィールドは、user.organizationalUnits 式を使用して解析されます。

    [
      {
        "organizationalUnitId": "ou_sdfadtaaxxxxxx",
        "organizationalUnitName": "AD",
        "primary": false
      },
      {
        "organizationalUnitId": "ou_werttxxxxxx",
        "organizationalUnitName": "name_002",
        "primary": true
      }
    ]
  2. id_token の organizationalUnitIds フィールドは、ArrayMap(user.organizationalUnits, __item.organizationalUnitId) 式を使用して解析されます。

    [
      "ou_sdfadtaaxxxxxx",
      "ou_werttxxxxxx"
    ]
  3. id_token の groups フィールドは、user.groups 式を使用して解析されます。

    [
      {
        "groupId": "group_jp6al4sn4n4wjgjxxxxxx",
        "groupName": "group1",
        "groupExternalId": "group_jp6al4sn4n4wjgjxxxxxx"
      },
      {
        "groupId": "group_vavikcxewkf5h3oxxxxxx",
        "groupName": "group2",
        "groupExternalId": "group_vavikcxewkf5h3oxxxxxx"
      }
    ]
  4. id_token の groupIds フィールドは、ArrayMap(user.groups, __item.groupId) 式を使用して解析されます。

    [
        "group_jp6al4sn4n4wjgjxxxxxx",
        "group_vavikcxewkf5h3oxxxxxx"
    ]
  5. id_token の groupExternalIds フィールドは、ArrayMap(user.groups, __item.groupExternalId) 式を使用して解析されます。

    [
        "group_jp6al4sn4n4wjgjxxxxxx",
        "group_vavikcxewkf5h3oxxxxxx"
    ]
  6. id_token の customFields フィールドは、user.customFields 式を使用して解析されます。

    [
        {
          "fieldName": "place",
          "fieldValue": "beijing"
        },
        {
          "fieldName": "age",
          "fieldValue": "18"
        }
    ]
  7. id_token の age フィールドは、user.customFieldMap.age.fieldValue 式を使用して解析されます。

    18

id_token 拡張フィールドの書き換えルール

デフォルトフィールドのルール

  1. デフォルトフィールドは、書き換えをサポートしていません: expnbfiatissjtiat_hashc_hashnoncesid

  2. 書き換えをサポートするフィールド: sub.

ユーザー情報フィールドのルール

user id_token の次のフィールドは、スコープに基づいて書き換えることができます。

フィールド名

関連付けられたスコープ

書き換え不可能な条件

email、email_verified

email

スコープに email が含まれており、ユーザーの email が空でない場合

phone_number、phone_number_verified

phone

スコープに phone が含まれており、ユーザーの phoneNumber が空でない場合

name、preferred_username、updated_at、locale

profile

スコープに profile が含まれている場合

instance_id、application_id

instance

スコープに instance が含まれている場合

構成の推奨事項

  1. ユーザー情報構成でスコープを選択する際は注意が必要です。これは、書き換え可能なユーザーフィールドに影響を与えるためです。

  2. 特定のフィールドを書き換えるには、対応するスコープが含まれていないか、対応するユーザーフィールドが空であることを確認する必要があります。