azure - Microsoft 授权端点 - 添加 Dynamics 365 Business Central 权限

标签 azure azure-active-directory microsoft-dynamics

我在特定的 Azure AD 目录中有一个 Multi-Tenancy 应用程序。 假设此应用程序的 ClientID=123456

为了将此应用程序添加到其他目录,我使用 Microsoft OAuth 2.0 Authorize endpoint

此应用程序实现同意框架,并使用范围参数设置所需的权限。

对于这个特定的应用程序 (ClientID=123456),并假设我需要这些权限:

  • openid 个人资料电子邮件

授权调用类似于:

https://login.microsoftonline.com/common/oauth2/v2.0/authorize?response_type=id_token&client_id=123456&redirect_uri=some_url&scope=email openid profile&response_mode=form_post&prompt=consent&nonce=123456778

如果使用上述内容,应用程序已正确安装在用户 Azure AD 中,并且权限已分配给应用程序。

现在,为了满足我们的特定要求,我们需要授予此特定权限:

enter image description here

理论上,这可以通过使用授权端点来完成:

https://login.microsoftonline.com/common/oauth2/v2.0/authorize?response_type=id_token&client_id=123456&redirect_uri=some_url&scope=https://dynamics.microsoft.com/business-central/overview/API.ReadWrite.All&response_mode=form_post&prompt=consent&nonce=12345677890111

不幸的是,这不起作用,同意提示根本不请求 D365 权限,并且不会分配给应用程序。

查看授权端点文档,没有任何内容表明不能使用此特定范围!

我在这里错过了什么,或者我做错了什么?

提前谢谢您。

最佳答案

我在特定的 Azure AD 目录中注册了一个 Multi-Tenancy 应用程序,并在范围为电子邮件 openid 配置文件时收到同意提示,并且与您在其他目录中的授权调用相同:

https://login.microsoftonline.com/common/oauth2/v2.0/authorize?response_type=id_token&client_id=123456&redirect_uri=some_url&scope=email openid profile&response_mode=form_post&prompt=consent&nonce=123456778

enter image description here

当我接受上述同意后,该应用程序添加到其他目录,并分配了相同权限,如下所示:

enter image description here

但是当我将范围更改为https://dynamics.microsoft.com/business-central/overview/API.ReadWrite.All并运行授权调用时,我没有收到任何同意提示。

To add API.ReadWrite.All Dynamics 365 Business Central permission, you need to change scope to https://api.businesscentral.dynamics.com/.default.

当我通过更改范围运行授权调用时,我收到了 Dynamics 365 Business Central 权限的同意提示,如下所示:

https://login.microsoftonline.com/common/oauth2/v2.0/authorize?response_type=code&client_id=123456&redirect_uri=some_url&scope=https://api.businesscentral.dynamics.com/.default&response_mode=form_post&prompt=consent&nonce=123456778

enter image description here

接受上述同意提示后,API.ReadWrite.All Dynamics 365 Business Central 权限已成功添加,如下所示:

enter image description here

就您而言,https://api.businesscentral.dynamics.com/.default 应该是添加 Application 类型权限时的范围值,并确保其他目录具有有效许可证支持其中包含 Dynamics 365。

关于azure - Microsoft 授权端点 - 添加 Dynamics 365 Business Central 权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76689205/

相关文章:

Azure 长期每日备份

azure - AAD应用权限问题

java - 将角色关联到用户 Microsoft Dynamics CRM(Rest API)

python - azure-sdk-for-python : get the LUN of a disk

c# - ASP.NET Core 1.1 在本地运行良好,但发布到 Azure 时显示 "An error occurred while starting the application."

azure - OAuth 应用程序身份扩展类

azure-active-directory - 403 Postman 调用动态 o365 web api 中的禁止错误

dynamics-crm - Dynamics CRM - 来自外部 Web 应用程序的页面

javascript - 如何将选项列表添加到自定义实体的案例表单中(注意 : replace the normal lookup field)?

Azure Graph API获取多个组中的所有用户