久久久久久久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 獲取訪問令牌)
主站蜘蛛池模板: 成人在线免费观看 | 91久久久精品国产一区二区蜜臀 | 国产一区二区精品在线观看 | 日韩欧美三级电影在线观看 | 日韩中文一区 | 欧美一区二区三区久久精品视 | 久久久中文 | 人妖av| 日韩成人精品视频 | 免费午夜剧场 | 国产欧美日韩在线观看 | 亚洲国产成人精品久久 | 国产高潮好爽受不了了夜色 | 日韩成人免费av | 99精品久久久 | 91精品国产综合久久婷婷香蕉 | 红色av社区 | 女人av | 精品国产一二三区 | 日本精品一区二区三区在线观看视频 | 国产精品久久欧美久久一区 | 在线观看成人小视频 | 成人精品鲁一区一区二区 | 亚洲自拍一区在线观看 | 日韩在线视频观看 | 日韩欧美在线观看 | 欧美中文在线 | 亚洲劲爆av | 成人在线免费网站 | 瑟瑟激情 | 国产成人在线一区二区 | 99re6在线视频精品免费 | 欧美日韩中文国产一区发布 | 手机av在线 | 国产日韩欧美一区二区 | 日韩一区三区 | 久久成人亚洲 | 黄色免费网站在线看 | 久久99视频| 欧美性生交大片免费 | 亚洲国产高清在线 |