英文:
How to remove the ask for consents for azure app registrations?
问题
I am building an application with the following setup:
-
使用以下设置构建应用程序:
-
An azure AD app registration reg1 to protect web apis (.NET 7), I use MS Identity.Web
-
一个Azure AD应用程序注册(reg1)用于保护Web API(.NET 7),我使用MS Identity.Web
-
An azure ADD app registration reg2 to protect a blazor server app which is the client app
-
一个Azure AD应用程序注册(reg2)用于保护Blazor服务器应用程序,这是客户端应用程序
-
reg1 exposes 3 scopes
-
reg1公开了3个范围
-
reg2 has the permission to access the scopes and is among the authorized client applications
-
reg2具有访问这些范围的权限,并且位于已授权的客户端应用程序之中
However, the client application always asks for consent and I am obliged to add a ConsentHandler in all the pages.
然而,客户端应用程序总是要求同意,我不得不在所有页面中添加ConsentHandler。
According to MS documentation, adding reg2 as an authorized app in reg1 should remove the need for asking users for consents but this is not the case.
根据Microsoft的文档,将reg2添加为reg1中的已授权应用程序应该可以避免要求用户同意,但实际情况并非如此。
How to disable asking for consents between these two apps?
如何禁用这两个应用程序之间的同意请求?
Thanks in advance
提前感谢
英文:
I am building an application with the following setup:
- An azure AD app registration reg1 to protect web apis (.NET 7), I use MS Identity.Web
- An azure ADD app registration reg2 to protect a blazor server app which is the client app
- reg1 exposes 3 scopes
- reg2 has the permission to access the scopes and is among the authorized client applications
However, the client application always asks for consent and I am obliged to add a ConsentHandler in all the pages.
According to MS documentation, adding reg2 as an authorized app in reg1 should remove the need for asking users for consents but this is not the case.
How to disable asking for consents between these two apps?
Thanks in advance
I added reg2 to the authorized apps but this did not work
答案1
得分: 1
在Azure门户中,转到Azure AD > 应用注册,然后点击您的API应用(reg1),接着点击“清单”。在那里搜索knownClientApplications
。只需在那里添加您前端应用程序(reg2)的应用程序(客户端)ID,类似于:
"knownClientApplications": ["<reg2客户端ID>"]
英文:
Please try to do the following:
In Azure Portal > Azure AD > App Registrations and click on your API app (reg1) and then click on Manifest. Search for knownClientApplications
there. Just add the Application (client) id of your frontend app (reg2) there. Something like:
"knownClientApplications": ["<reg2 client id>"],
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论