このトピックでは、Security Assertion Markup Language(SAML)属性ステートメントを構成するためのルールについて説明し、構成例を示します。
SAML値の説明
タイプ | 値 | 説明 |
変数 | user.username | ユーザー名。 |
user.displayName | 表示名。 | |
user.phone (期限切れ) | 国別コードを含まない、期限切れの携帯電話番号。 | |
user.phoneNumber | 国別コードを含まない携帯電話番号。 | |
user.email | メールアドレス。 | |
user.status | ユーザーのステータス。有効な値:
| |
user.primaryOrganizationalUnitId | ユーザーが所属するプライマリ組織の ID。 | |
ObjectToJsonString(user.organizationalUnits) | ユーザーが所属する組織の情報。 値は JSON 配列文字列です。 | |
ArrayJoin(ArrayMap(user.organizationalUnits, __item.organizationalUnitId), ",") | ユーザーが所属する組織の ID。 値は JSON 配列文字列です。 | |
ObjectToJsonString(user.groups) | アカウントが所属するグループの情報。 値は JSON 配列文字列です。 | |
ArrayJoin(ArrayMap(user.groups, __item.groupId), ",") | アカウントが所属するグループの ID。 値は JSON 配列文字列です。 | |
ArrayJoin(ArrayMap(user.groups, __item.groupExternalId), ",") | アカウントが所属するグループの外部 ID。 値は JSON 配列文字列です。 | |
ObjectToJsonString(user.customFields) | すべての拡張フィールドの情報。 値は JSON 配列文字列です。 | |
user.customFieldMap.$fieldname$.fieldValue | 拡張フィールドの値。 | |
appUser.username | アプリケーションアカウント。 | |
定数 | 定数は二重引用符("")で囲みます。 | |
式 | 高度な機能。式を使用して、値を柔軟に連結および変更できます。 詳細については、「アカウントフィールドの高度な式」をご参照ください。 | |
SAML式の例
例: user オブジェクト
{
// ...
"customFieldMap": { // カスタムフィールドマップ
"place": { // 場所
"fieldName": "place", // フィールド名:場所
"fieldValue": "beijing" // フィールド値:北京
},
"age": { // 年齢
"fieldName": "age", // フィールド名:年齢
"fieldValue": "18" // フィールド値:18
}
},
"identityProviderUserMap": { // IDプロバイダーユーザーマップ
"idp_m2gngriuenktdkxxxxxx": { // IDプロバイダーID
"identityProviderId": "idp_m2gngriuenktdkxxxxxx", // IDプロバイダーID
"identityProviderType": "ding_talk", // IDプロバイダータイプ:DingTalk
"identityProviderExternalId": "corp_1234xxxxxxx", // IDプロバイダー外部ID
"identityProviderUserId": "b2ed5fc0xxxxx" // IDプロバイダーユーザーID
}
},
"organizationalUnits": [ // 組織単位
{
"organizationalUnitId": "ou_sdfadtaaxxxxxx", // 組織単位ID
"organizationalUnitName": "AD", // 組織単位名:AD
"primary": false // プライマリ:false
},
{
"organizationalUnitId": "ou_werttxxxxxx", // 組織単位ID
"organizationalUnitName": "name_002", // 組織単位名:name_002
"primary": true // プライマリ:true
}
],
"primaryOrganizationalUnitId": "ou_werttxxxxxx", // プライマリ組織単位ID
"customFields": [ // カスタムフィールド
{
"fieldName": "place", // フィールド名:場所
"fieldValue": "beijing" // フィールド値:北京
},
{
"fieldName": "age", // フィールド名:年齢
"fieldValue": "18" // フィールド値:18
}
],
"groups": [ // グループ
{
"groupId": "group_jp6al4sn4n4wjgjxxxxxx", // グループID
"groupName": "group1", // グループ名:group1
"groupExternalId": "group_jp6al4sn4n4wjgjxxxxxx" // グループ外部ID
},
{
"groupId": "group_vavikcxewkf5h3oxxxxxx", // グループID
"groupName": "group2", // グループ名:group2
"groupExternalId": "group_vavikcxewkf5h3oxxxxxx" // グループ外部ID
}
],
// ...
}SAML インターフェイスの構成例

SAML 解析結果の例
属性ステートメントの organizationalUnits フィールドを ObjectToJsonString(user.organizationalUnits) 式を使用して解析した後に、次の SAML 応答が返されます。
<saml2:Attribute Name="organizationalUnits" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"> <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:string"> [{"organizationalUnitId":"ou_sdfadtaaxxxxxx","organizationalUnitName":"AD","primary":false},{"organizationalUnitId":"ou_werttxxxxxx","organizationalUnitName":"name_002","primary":true}] </saml2:AttributeValue> </saml2:Attribute>ArrayJoin(ArrayMap(user.organizationalUnits, __item.organizationalUnitId), ",") 式を使用して属性ステートメントの organizationalUnitIds フィールドを解析した後、次の SAML 応答が返されます。
<saml2:Attribute Name="organizationalUnitIds" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"> <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:string"> ou_sdfadtaaxxxxxx,ou_werttxxxxxx </saml2:AttributeValue> </saml2:Attribute>ObjectToJsonString(user.groups) 式を使用して属性ステートメントの groups フィールドを解析した後、次の SAML 応答が返されます。
<saml2:Attribute Name="groups" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"> <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:string"> [{"groupId":"group_jp6al4sn4n4wjgjxxxxxx","groupName":"group1","groupExternalId":"group_jp6al4sn4n4wjgjxxxxxx"},{"groupId":"group_vavikcxewkf5h3oxxxxxx","groupName":"group2","groupExternalId":"group_vavikcxewkf5h3oxxxxxx"}] </saml2:AttributeValue> </saml2:Attribute>ArrayJoin(ArrayMap(user.groups, __item.groupId), ",") 式を使用して属性ステートメントの groupIds フィールドを解析した後、次の SAML 応答が返されます。
<saml2:Attribute Name="groupIds" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"> <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:string"> group_jp6al4sn4n4wjgjxxxxxx,group_vavikcxewkf5h3oxxxxxx </saml2:AttributeValue> </saml2:Attribute>ArrayJoin(ArrayMap(user.groups, __item.groupExternalId), ",") 式を使用して属性ステートメントの groupExternalIds フィールドを解析した後、次の SAML 応答が返されます。
<saml2:Attribute Name="groupExternalIds" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"> <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:string"> group_jp6al4sn4n4wjgjxxxxxx,group_vavikcxewkf5h3oxxxxxx </saml2:AttributeValue> </saml2:Attribute>SamlArray(ArrayMap(user.groups, __item.groupId)) 式を使用して属性ステートメントの grouIdArray フィールドを解析した後、次の SAML 応答が返されます。
<saml2:Attribute Name="grouIdArray" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"> <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:type="xsd:string"> group_jp6al4sn4n4wjgjxxxxxx </saml2:AttributeValue> <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:string"> group_vavikcxewkf5h3oxxxxxx </saml2:AttributeValue> </saml2:Attribute>ObjectToJsonString(user.customFields) 式を使用して属性ステートメントの customFields フィールドを解析した後、次の SAML 応答が返されます。
<saml2:Attribute Name="customFields" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"> <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:type="xsd:string"> [{"fieldName":"place","fieldValue":"beijing"},{"fieldName":"age","fieldValue":"18"}] </saml2:AttributeValue> </saml2:Attribute>user.customFieldMap.age.fieldValue 式を使用して属性ステートメントの age フィールドを解析した後、次の SAML 応答が返されます。
<saml2:Attribute Name="age" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"> <saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:string"> 18 </saml2:AttributeValue> </saml2:Attribute>