久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何在 ASP.NET MVC 中獲取/設置自定義 Azure Active

How to get/set custom Azure Active Directory B2C user attributes in ASP.NET MVC?(如何在 ASP.NET MVC 中獲取/設置自定義 Azure Active Directory B2C 用戶屬性?)
本文介紹了如何在 ASP.NET MVC 中獲取/設置自定義 Azure Active Directory B2C 用戶屬性?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我在 Azure Active Directory B2C 租戶中添加了一個自定義 Organization 字段作為用戶屬性,如下所示:

I have added a custom Organization field as a User Attribute in my Azure Active Directory B2C tenant, like so:

我正在使用 Microsoft Graph .NET 客戶端庫來管理 Azure 中的用戶Active Directory B2C 并希望使用類似于以下代碼的內容來設置用戶的自定義 Organization 字段和用戶的內置 Email Addresses 字段.

I am using the Microsoft Graph .NET Client Library to manage users in Azure Active Directory B2C and would like to use something similar to the following code to set the user's custom Organization field and the user's built-in Email Addresses field.

await graphClient.Users[user.Id].Request().UpdateAsync(new User()
{
    Email Addresses = new StringCollection("myemail@mydomain.com")
    Organization = "Microsoft"
});

兩個問題:

  1. 如何設置內置字段,例如 電子郵件地址?
  2. 如何設置自定義字段,例如 Organization?

本文檔顯示 如何創建自定義屬性,但不告訴如何使用圖形客戶端訪問或使用該屬性.

This documentation shows how to create a custom attribute but does not tell how to access or use that attribute using the Graph Client.

本文檔展示了如何創建自定義屬性并編輯依賴方 (RP) 文件.

有沒有更簡單的方法?然后獲取/設置這些自定義用戶屬性的 graphClient 代碼是什么?

Is there an easier way? And what is the graphClient code to then get/set these custom user attributes?

推薦答案

Microsoft Graph API 以及 Microsoft Graph 客戶端是否支持向 Azure AD B2C 租戶注冊的擴展屬性有點令人困惑.

It is a bit confusing about whether the Microsoft Graph API, and hence the Microsoft Graph Client, supports the extension properties that are registered with an Azure AD B2C tenant.

當我使用 Azure AD Graph API 查詢用戶對象時,會返回自定義屬性(例如CreatedTime").

When I query a user object using the Azure AD Graph API, then the custom attributes (e.g. "CreatedTime") are returned.

https://graph.windows.net/{tenant}/users/{objectId}

返回:

{
    "odata.metadata": "https://graph.windows.net/{tenant}/$metadata#directoryObjects/Microsoft.DirectoryServices.User/@Element",
    "odata.type": "Microsoft.DirectoryServices.User",
    "objectType": "User",
    ...
    "extension_917ef9adff534c858b0a683b6e6ec0f3_CreatedTime": 1518602039
}

當我使用 Microsoft Graph API 查詢同一個對象時,不會返回自定義屬性.

When I query the same object using the Microsoft Graph API, then the custom attributes aren't returned.

https://graph.microsoft.com/v1.0/users/{id}/extensions

返回:

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('{id}')/extensions",
    "value": []
}

除非您收到更好的答案,否則我建議您使用 Azure AD Graph API,也可以選擇 Azure AD Graph 客戶端,用于獲取和設置 Azure AD B2C 用戶的擴展屬性.

Unless you receive a better answer, then I suggest you use the Azure AD Graph API, and optionally the Azure AD Graph Client, to get and set the extension properties for the Azure AD B2C users.

獲取和設置用戶擴展屬性的示例可以在 宣布 Azure AD Graph API 客戶端庫 2.0

Examples of getting and setting the extension properties for users can be found at Announcing Azure AD Graph API Client Library 2.0

這篇關于如何在 ASP.NET MVC 中獲取/設置自定義 Azure Active Directory B2C 用戶屬性?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

ASP.NET Core authenticating with Azure Active Directory and persisting custom Claims across requests(ASP.NET Core 使用 Azure Active Directory 進行身份驗證并跨請求保留自定義聲明)
ASP.NET Core 2.0 Web API Azure Ad v2 Token Authorization not working(ASP.NET Core 2.0 Web API Azure Ad v2 令牌授權不起作用)
How do I get Azure AD OAuth2 Access Token and Refresh token for Daemon or Server to C# ASP.NET Web API(如何獲取守護進程或服務器到 C# ASP.NET Web API 的 Azure AD OAuth2 訪問令牌和刷新令牌) - IT屋-程序員軟件開發技
.Net Core 2.0 - Get AAD access token to use with Microsoft Graph(.Net Core 2.0 - 獲取 AAD 訪問令牌以與 Microsoft Graph 一起使用)
Azure KeyVault Active Directory AcquireTokenAsync timeout when called asynchronously(異步調用時 Azure KeyVault Active Directory AcquireTokenAsync 超時)
Getting access token using email address and app password from oauth2/token(使用電子郵件地址和應用程序密碼從 oauth2/token 獲取訪問令牌)
主站蜘蛛池模板: 国产精品成人国产乱一区 | 亚洲成av人片在线观看无码 | 黄片毛片免费观看 | 一区欧美| 婷婷激情综合 | 久久国产综合 | 91精品国产日韩91久久久久久 | 亚洲免费大片 | 日韩1区 | 日韩电影a | 日韩成人免费 | 亚洲欧美日韩精品久久亚洲区 | 国产精品久久 | 欧美三区在线观看 | 日韩福利片 | 欧美一区二区三区在线视频 | 97精品超碰一区二区三区 | 天天操操| 亚洲第一天堂 | 欧美lesbianxxxxhd视频社区 | 国产精品一区二区三区在线 | 日韩中文视频 | 精品无码久久久久久国产 | 美女人人操 | 能免费看的av | 一区二区三区中文字幕 | 国产韩国精品一区二区三区 | 国产成都精品91一区二区三 | 国产一区二区在线播放 | 日韩成人免费视频 | 成人精品在线观看 | av日韩在线播放 | 国产日韩精品一区二区 | 亚洲视频免费在线播放 | 超碰在线97国产 | 亚洲欧美综合 | 久久国产精品久久久久久 | 亚洲高清免费观看 | 福利视频1000| 国产高清91| 一区二区三区欧美 |