Is it possible to configure Azure Digital Twins API access for a Daemon App?

随声附和 提交于 2020-06-29 07:05:34

问题


To automate maintenance of an Azure Digital Twins instance, we require service-to-service API access so that we can use Azure middle-tier options to run as daemon apps (e.g. Logic App or Function).

However, the Azure Digitial Twins 'preview' API (resource id: 0b07f429-9f4b-4714-9392-cc5e8e80c8b0) does not support Application Permissions when registering the application in Azure Active Directory (only Delegated Permissions). However, the related Microsoft Graph API (resource id: 00000003-0000-0000-c000-000000000000) supports both permission types.

Is there any way currently to authenticate for access to the Azure Digital Twins API without the need for a signed-in AAD account (i.e. using 'client_credentials' grant type)?


回答1:


To use client credential flow, you need the Application permission. If there is just Delegated Permission defined in the API, you could just access the API with a signed-in user account, e.g. authorization code flow.

In your case, the option is On-Behalf-Of flow.

  1. The user authenticate with the middle-tier application with authorization code flow or another login flow

  2. An OAuth 2.0 On-Behalf-Of token is acquired during authentication

  3. The acquired token is then used to authenticate with or call APIs that are further downstream using the On-Behalf-Of flow

For more details, check this doc - Call Digital Twins from a middle-tier web API.



来源:https://stackoverflow.com/questions/60311384/is-it-possible-to-configure-azure-digital-twins-api-access-for-a-daemon-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!