この記事は、とりとめのないメモです。
Entrra ID ユーザーとセットで雑多な情報を格納したい
カスタムセキュリティ属性を使う
こんなシナリオで使う。
- Extend user profiles, such as add Hourly Salary to all my employees.
- Ensure only administrators can see the Hourly Salary attribute in my employees' profiles.
- Categorize hundreds or thousands of applications to easily create a filterable inventory for auditing.
- Grant users access to the Azure Storage blobs belonging to a project.
3つのデータ型がある。
- 真偽値
- 32ビット整数
- 文字列
Graph APIを使用してカスタムデータを格納する
4 つの方法がある。
- 拡張属性
- ディレクトリ拡張
- スキーマ拡張
- オープン拡張
拡張属性へ格納する
onPremisesExtensionAttributes
というプロパティに、15個の値を格納できる。
データ型は文字列のみ。
Active Directoryと同期している(ハイブリッドジョイン環境)だと使えない。
更新 Graph API
PATCH /users/{id | userPrincipalName}
onPremisesExtensionAttributes
に格納する。
ディレクトリ拡張を使う
Entra IDに登録したアプリケーションにおいて、extensionProperty
を定義する。
管理者かユーザーがアプリケーションの使用に同意すると、そのテナントで使用できるようになる。
Entra IDのオブジェクトに対して、extension_Object ID_extensionProperty名 というプロパティをセットできるようになる。
ディレクトリ拡張を定義する Graph API
POST /applications/{application ObjectId}/extensionProperties
POST /applications(appId='{appId}')/extensionProperties
スキーマ拡張を使う
ディレクトリ拡張と似たようなもの。
ディレクトリ拡張を定義する Graph API
POST /schemaExtensions
オープン拡張を使う
これもまたディレクトリ拡張と似たようなもの。
あらかじめ定義しておかなくてもいい(っぽい)。
オープン拡張を保存する Graph API
POST /users/{id|userPrincipalName}/extensions
リクエストボディ
{
"extensionName": "string",
"id": "String (identifier)",
/* その他任意のプロパティ */
}
オープン拡張を読み込む Graph API
GET /users/{Id|userPrincipalName}/extensions/{extensionId}