pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

新的 Azure AD 應(yīng)用程序在通過管理門戶更新之前無

New Azure AD application doesn#39;t work until updated through management portal(新的 Azure AD 應(yīng)用程序在通過管理門戶更新之前無法運(yùn)行)
本文介紹了新的 Azure AD 應(yīng)用程序在通過管理門戶更新之前無法運(yùn)行的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

限時送ChatGPT賬號..

我使用 AAD Graph API 在 Azure AD 中創(chuàng)建了一個新應(yīng)用程序.(代碼)

I have created a new application in Azure AD using the AAD Graph API. (code)

不幸的是,在我訪問 Azure 管理門戶中的應(yīng)用程序配置頁面并進(jìn)行外觀更改并保存之前,它不允許我的客戶端訪問請求的資源.刪除更改并再次保存后,它仍然有效.更改 + 回退步驟之前和之后的應(yīng)用程序清單文件完全相同(正如 diff.exe 中所說的一樣).

Unfortunately it doesn't let my client access the requested resources until I have been to the application's configuration page in the Azure management portal and made a cosmetic change, and then saved it. After removing the change and saving again, it still works. The application manifest files before the change + change back steps and after them are completely identical (as in diff.exe says they are the same).

比較應(yīng)用程序認(rèn)證時返回的 JWT 令牌時,表明更改后訪問令牌包含角色"部分.在將應(yīng)用程序保存到管理門戶之前返回的訪問令牌中不存在整個角色"部分.

When comparing the JWT tokens returned when the application authenticates, it shows that the post-change access token includes the "roles" section. The entire "roles" section is not present in the access token returned before saving the application in the management portal.

因此,在保存更改時,Azure 管理門戶似乎對應(yīng)用程序做了某些事情".問題是它是什么,我可以使用 AAD 圖形 API 做同樣的事情嗎?

So it seems the Azure management portal does "something" to the application when saving changes. The question is what it is, and can I do the same using the AAD graph API?

推薦答案

有幾個問題.Azure 后端的一些錯誤,現(xiàn)在已經(jīng)修復(fù),還有一些我不知道的對 API 的缺失調(diào)用是必要的.多虧了 MS Support 的一些非常樂于助人的人,我們才得以讓它發(fā)揮作用.

There were several issues. Some bugs in the backend on Azure, which have now been fixed, and also some missing calls to the API which I didn't know were necessary. Thanks to some very helpful people at MS Support, we were able to get it to work.

在創(chuàng)建應(yīng)用程序時,您需要執(zhí)行以下操作:

When creating an application, you need to do the following:

  1. 創(chuàng)建一個 應(yīng)用程序?qū)ο?
  2. 設(shè)置 RequiredResourceAccess,即.應(yīng)用程序?qū)?Azure Graph API 等具有哪些權(quán)限.這是在門戶的對其他應(yīng)用程序的權(quán)限"設(shè)置中配置的內(nèi)容.您可以通過手動配置權(quán)限來獲取必要的 GUID,然后查看應(yīng)用程序的 AAD 清單文件.
  3. 創(chuàng)建一個 應(yīng)用程序的服務(wù)主體.
  4. 添加 AppRoleAssignments 到服務(wù)主體.
  1. Create an application object.
  2. Setup the RequiredResourceAccess for the application, ie. which permissions the appliation has to Azure Graph API etc. This is what is configured in the portal's "permissions to other applications" settings. You can get the necessary GUIDs by configuring the permissions manually, and then looking in the application's AAD manifest file.
  3. Create a service principal for the application.
  4. Add AppRoleAssignments to the service principal.

最后一部分是我之前缺少的.即使您在應(yīng)用程序?qū)ο笊吓渲昧薘equiredResourceAccess,服務(wù)主體仍然需要 AppRoleAssignments 才能真正擁有訪問資源的權(quán)限.

The final part is what I was missing before. Even though you have configured RequiredResourceAccess on the application object, the service principal still needs the AppRoleAssignments to actually have permission to access the resources.

在創(chuàng)建 AppRoleAssignments 時,要確定要分配哪個 PrincipalId 有點(diǎn)棘手,因為那是其他資源的服務(wù)主體的 AAD ObjectId.

When creating the AppRoleAssignments it is a little bit tricky to figure out which PrincipalId to assign, since that is the AAD ObjectId of the service principal for the other resource.

這里是添加 AppRoleAssignment 以訪問 Azure AD Graph API 的片段.client 是一個 ActiveDirectoryClient實例,而 sp 是我的應(yīng)用程序的 ServicePrincipal:

Here is a snippet for adding the AppRoleAssignment to access the Azure AD Graph API. client is an ActiveDirectoryClient instance, and sp is the ServicePrincipal for my application:

// find the azure ad service principal
var aadsp =
     client.ServicePrincipals.Where(csp => csp.AppId == "00000002-0000-0000-c000-000000000000")
     .ExecuteSingleAsync().Result;

// create the app role assignment
var azureDirectoryReadAssignment = new AppRoleAssignment
{
    PrincipalType = "ServicePrincipal",
    PrincipalId = Guid.Parse(sp.ObjectId), //
    Id = Guid.Parse("5778995a-e1bf-45b8-affa-663a9f3f4d04"), // id for Directory.Read
    // azure active directory resource ID
    ResourceId = Guid.Parse(aadsp.ObjectId) // azure active directory resource ID
};
// add it to the service principal
sp.AppRoleAssignments.Add(azureDirectoryReadAssignment);
// update the service principal in AAD
await sp.UpdateAsync();

我的經(jīng)驗是,在新創(chuàng)建的對象在 AAD 中有效之前,您需要等待很短的時間,可能是 2-3 分鐘,然后您才能使用新應(yīng)用程序進(jìn)行身份驗證.

My experience is that you need to wait a short time, maybe 2-3 minutes, before the newly created objects are valid in AAD, and then you can authenticate using the new application.

這篇關(guān)于新的 Azure AD 應(yīng)用程序在通過管理門戶更新之前無法運(yùn)行的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

相關(guān)文檔推薦

ASP.NET Core authenticating with Azure Active Directory and persisting custom Claims across requests(ASP.NET Core 使用 Azure Active Directory 進(jìn)行身份驗證并跨請求保留自定義聲明)
ASP.NET Core 2.0 Web API Azure Ad v2 Token Authorization not working(ASP.NET Core 2.0 Web API Azure Ad v2 令牌授權(quán)不起作用)
ASP Core Azure Active Directory Login use roles(ASP Core Azure Active Directory 登錄使用角色)
How do I get Azure AD OAuth2 Access Token and Refresh token for Daemon or Server to C# ASP.NET Web API(如何獲取守護(hù)進(jìn)程或服務(wù)器到 C# ASP.NET Web API 的 Azure AD OAuth2 訪問令牌和刷新令牌) - IT屋-程序員軟件開發(fā)技
.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(異步調(diào)用時 Azure KeyVault Active Directory AcquireTokenAsync 超時)
主站蜘蛛池模板: 彭世修脚_修脚加盟_彭世修脚加盟_彭世足疗加盟_足疗加盟连锁_彭世修脚技术培训_彭世足疗 | 网优资讯-为循环资源、大宗商品、工业服务提供资讯与行情分析的数据服务平台 | 棕刚玉-白刚玉厂家价格_巩义市东翔净水材料厂 | 青海电动密集架_智能密集架_密集架价格-盛隆柜业青海档案密集架厂家 | 转子泵_凸轮泵_凸轮转子泵厂家-青岛罗德通用机械设备有限公司 | 超声波清洗机_超声波清洗机设备_超声波清洗机厂家_鼎泰恒胜 | 不锈钢轴流风机,不锈钢电机-许昌光维防爆电机有限公司(原许昌光维特种电机技术有限公司) | 广州食堂承包_广州团餐配送_广州堂食餐饮服务公司 - 旺记餐饮 | 刹车盘机床-刹车盘生产线-龙口亨嘉智能装备 | 铸铝门厂家,别墅大门庭院大门,别墅铸铝门铜门[十大品牌厂家]军强门业 | 万师讲师网-优质讲师培训师供应商,讲师认证,找讲师来万师 | 刘秘书_你身边专业的工作范文写作小秘书 | 苗木价格-苗木批发-沭阳苗木基地-沭阳花木-长之鸿园林苗木场 | 耐高温风管_耐高温软管_食品级软管_吸尘管_钢丝软管_卫生级软管_塑料波纹管-东莞市鑫翔宇软管有限公司 | 提升海外网站流量,增加国外网站访客UV,定制海外IP-访客王 | 山东氧化铁红,山东铁红-淄博科瑞化工有限公司 | 酒店厨房设计_中央厨房设计_北京商用厨房设计公司-奇能商厨 | 服务器之家 - 专注于服务器技术及软件下载分享 | 顺景erp系统_erp软件_erp软件系统_企业erp管理系统-广东顺景软件科技有限公司 | 深圳昂为官网-气体分析仪,沼气分析仪,动态配气仪,气体传感器厂家 | 济南侦探调查-济南调查取证-山东私家侦探-山东白豹调查咨询公司 密集架|电动密集架|移动密集架|黑龙江档案密集架-大量现货厂家销售 | 安全阀_弹簧式安全阀_美标安全阀_工业冷冻安全阀厂家-中国·阿司米阀门有限公司 | Honsberg流量计-Greisinger真空表-气压计-上海欧臻机电设备有限公司 | 布袋除尘器|除尘器设备|除尘布袋|除尘设备_诺和环保设备 | TYPE-C厂家|TYPE-C接口|TYPE-C防水母座|TYPE-C贴片-深圳步步精 | 砂石生产线_石料生产线设备_制砂生产线设备价格_生产厂家-河南中誉鼎力智能装备有限公司 | 青岛球场围网,青岛车间隔离网,青岛机器人围栏,青岛水源地围网,青岛围网,青岛隔离栅-青岛晟腾金属制品有限公司 | 伺服电机_直流伺服_交流伺服_DD马达_拓达官方网站 | 货车视频监控,油管家,货车油管家-淄博世纪锐行电子科技 | 黄石妇科医院_黄石东方女子医院_黄石东方妇产医院怎么样 | 杭州成人高考_浙江省成人高考网上报名 | 上海诺狮景观规划设计有限公司| 防水试验机_防水测试设备_防水试验装置_淋雨试验箱-广州岳信试验设备有限公司 | 上海租车公司_上海包车_奔驰租赁_上海商务租车_上海谐焕租车 | 国际线缆连接网 - 连接器_线缆线束加工行业门户网站 | 奇酷教育-Python培训|UI培训|WEB大前端培训|Unity3D培训|HTML5培训|人工智能培训|JAVA开发的教育品牌 | 三轴曲线机-端子插拔力试验机|华杰仪器 | 网站建设-高端品牌网站设计制作一站式定制_杭州APP/微信小程序开发运营-鼎易科技 | 发光字|标识设计|标牌制作|精神堡垒 - 江苏苏通广告有限公司 | 苏商学院官网 - 江苏地区唯一一家企业家自办的前瞻型、实操型商学院 | 天津热油泵_管道泵_天津高温热油泵-天津市金丰泰机械泵业有限公司【官方网站】 |