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

Identity as a Service:OIDC id_token カスタムフィールドの設定

最終更新日:Jun 22, 2026

このトピックでは、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

特定のカスタムフィールドの値。$fieldname$ をカスタムフィールドの名前に置き換えてください。

定数

固定文字列値。定数は二重引用符 ("") で囲んでください。

値の連結または変換を行うための詳細設定機能。

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

ユーザーオブジェクトの例:

{
  ...
  "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",
    "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 式の例

Identity as a Service (IDaaS) の application ページで、[Hide advanced configuration] をクリックすると、詳細設定エリアが展開されます。[Extend id_token] セクションで、カスタムフィールド名とそれに対応する式をマッピングテーブルに追加します。

  1. user.organizationalUnits は、次の値を返します:

    [
      {
        "organizationalUnitId": "ou_sdfadtaaxxxxxx",
        "organizationalUnitName": "AD",
        "primary": false
      },
      {
        "organizationalUnitId": "ou_werttxxxxxx",
        "organizationalUnitName": "name_002",
        "primary": true
      }
    ]
  2. ArrayMap(user.organizationalUnits, __item.organizationalUnitId) は、次の値を返します:

    [
      "ou_sdfadtaaxxxxxx",
      "ou_werttxxxxxx"
    ]
  3. user.groups は、次の値を返します:

    [
      {
        "groupId": "group_jp6al4sn4n4wjgjxxxxxx",
        "groupName": "group1",
        "groupExternalId": "group_jp6al4sn4n4wjgjxxxxxx"
      },
      {
        "groupId": "group_vavikcxewkf5h3oxxxxxx",
        "groupName": "group2",
        "groupExternalId": "group_vavikcxewkf5h3oxxxxxx"
      }
    ]
  4. ArrayMap(user.groups, __item.groupId) は、次の値を返します:

    [
        "group_jp6al4sn4n4wjgjxxxxxx",
        "group_vavikcxewkf5h3oxxxxxx"
    ]
  5. ArrayMap(user.groups, __item.groupExternalId) は、次の値を返します:

    [
        "group_jp6al4sn4n4wjgjxxxxxx",
        "group_vavikcxewkf5h3oxxxxxx"
    ]
  6. user.customFields は、次の値を返します:

    [
        {
          "fieldName": "place",
          "fieldValue": "beijing"
        },
        {
          "fieldName": "age",
          "fieldValue": "18"
        }
    ]
  7. user.customFieldMap.age.fieldValue は、次の値を返します:

    18

id_token カスタムフィールドの書き換えルール

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

  1. システムのデフォルトフィールドは 書き換えできませんexpnbfiatissjtiat_hashc_hashnoncesid

  2. 次のフィールドの書き換えは サポートされていますsub

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

id_token 内の以下のユーザー情報フィールドを書き換えられるかどうかは、リクエストされた スコープ によって異なります。

フィールド名

関連するスコープ

書き換え不可の条件

emailemail_verified

email

リクエストされた スコープemail が含まれており、かつユーザーのメール属性が空でない場合。

phone_numberphone_number_verified

phone

リクエストされた スコープphone が含まれており、かつユーザーの phoneNumber 属性が空でない場合。

namepreferred_usernameupdated_atlocale

profile

リクエストされた スコープprofile が含まれている場合。

instance_idapplication_id

instance

リクエストされた スコープinstance が含まれている場合。

設定の推奨事項

  1. アプリケーションの設定でスコープを慎重に選択してください。リクエストするスコープによって、書き換え可能なユーザーフィールドが決まります。

  2. 特定のフィールドを書き換えるには、関連する スコープ をリクエストしないか、対応するユーザー属性が空であることを確認してください。