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 超時)
主站蜘蛛池模板: 接地电阻测试仪[厂家直销]_电缆故障测试仪[精准定位]_耐压测试仪-武汉南电至诚电力设备 | 低压载波电能表-单相导轨式电能表-华邦电力科技股份有限公司-智能物联网综合管理平台 | 药品仓库用除湿机-变电站用防爆空调-油漆房用防爆空调-杭州特奥环保科技有限公司 | 耐高温风管_耐高温软管_食品级软管_吸尘管_钢丝软管_卫生级软管_塑料波纹管-东莞市鑫翔宇软管有限公司 | 变色龙PPT-国内原创PPT模板交易平台 - PPT贰零 - 西安聚讯网络科技有限公司 | 北京网站建设公司_北京网站制作公司_北京网站设计公司-北京爱品特网站建站公司 | NBA直播_NBA直播免费观看直播在线_NBA直播免费高清无插件在线观看-24直播网 | 工业制氮机_psa制氮机厂家-宏骁智能装备科技江苏有限公司 | 红外光谱仪维修_二手红外光谱仪_红外压片机_红外附件-天津博精仪器 | 蓝莓施肥机,智能施肥机,自动施肥机,水肥一体化项目,水肥一体机厂家,小型施肥机,圣大节水,滴灌施工方案,山东圣大节水科技有限公司官网17864474793 | 济南品牌包装设计公司_济南VI标志设计公司_山东锐尚文化传播 | 照相馆预约系统,微信公众号摄影门店系统,影楼管理软件-盟百网络 | 恒湿机_除湿加湿一体机_恒湿净化消毒一体机厂家-杭州英腾电器有限公司 | 烟气在线监测系统_烟气在线监测仪_扬尘检测仪_空气质量监测站「山东风途物联网」 | 汽车整车综合环境舱_军标砂尘_盐雾试验室试验箱-无锡苏南试验设备有限公司 | 芜湖厨房设备_芜湖商用厨具_芜湖厨具设备-芜湖鑫环厨具有限公司 控显科技 - 工控一体机、工业显示器、工业平板电脑源头厂家 | 滑板场地施工_极限运动场地设计_滑板公园建造_盐城天人极限运动场地建设有限公司 | 杭州火蝠电商_京东代运营_拼多多全托管代运营【天猫代运营】 | 集菌仪_智能集菌仪_全封闭集菌仪_无菌检查集菌仪厂家-那艾 | 厌氧反应器,IC厌氧反应器,厌氧三相分离器-山东创博环保科技有限公司 | 吸污车_吸粪车_抽粪车_电动三轮吸粪车_真空吸污车_高压清洗吸污车-远大汽车制造有限公司 | 数字展示在线_数字展示行业门户网站 | 河南15年专业网站建设制作设计,做网站就找郑州启凡网络公司 | 量子管通环-自清洗过滤器-全自动反冲洗过滤器-北京罗伦过滤技术集团有限公司 | 首页-浙江橙树网络技术有限公司 石磨面粉机|石磨面粉机械|石磨面粉机组|石磨面粉成套设备-河南成立粮油机械有限公司 | 喷砂机厂家_自动喷砂机生产_新瑞自动化喷砂除锈设备 | 粉末冶金注射成型厂家|MIM厂家|粉末冶金齿轮|MIM零件-深圳市新泰兴精密科技 | 云杂志网-学术期刊-首页 | 网站建设-高端品牌网站设计制作一站式定制_杭州APP/微信小程序开发运营-鼎易科技 | 桂林腻子粉_内墙外墙抗裂砂浆腻子粉推荐广西鑫达涂料厂家供应 | 圆窗水平仪|伊莉莎冈特elesa+ganter| 网站优化公司_北京网站优化_抖音短视频代运营_抖音关键词seo优化排名-通则达网络 | 隧道烘箱_隧道烘箱生产厂家-上海冠顶专业生产烘道设备 | 防水试验机_防水测试设备_防水试验装置_淋雨试验箱-广州岳信试验设备有限公司 | 品牌策划-品牌设计-济南之式传媒广告有限公司官网-提供品牌整合丨影视创意丨公关活动丨数字营销丨自媒体运营丨数字营销 | 塑胶跑道施工-硅pu篮球场施工-塑胶网球场建造-丙烯酸球场材料厂家-奥茵 | 影像测量仪_三坐标测量机_一键式二次元_全自动影像测量仪-广东妙机精密科技股份有限公司 | 厂房出售_厂房仓库出租_写字楼招租_土地出售-中苣招商网-中苣招商网 | 附着力促进剂-尼龙处理剂-PP处理剂-金属附着力处理剂-东莞市炅盛塑胶科技有限公司 | 美国HASKEL增压泵-伊莱科elettrotec流量开关-上海方未机械设备有限公司 | 工业洗衣机_工业洗涤设备_上海力净工业洗衣机厂家-洗涤设备首页 bkzzy在职研究生网 - 在职研究生招生信息咨询平台 |