如何授权从 Power Automate Desktop 到 Dataverse 的请求?
我正在寻找一些有关授权我在 Power Automate Desktop 中使用“调用 Web 服务”操作发出的请求的建议。我正在使用此请求从 Dataverse 获取信息。
我目前已使用 OAuth2.0 设置此请求,并将授予类型设置为隐式,并将令牌值硬编码到标头中。我对授权很陌生,所以我只是想知道这是否是使用 OAuth2.0 从 Dataverse 到 PAD 获取信息的最佳方式?我还担心这个令牌会过期以及如何处理它。如果我应该进行不同的设置,请告诉我。如果您知道我如何以某种方式自动刷新令牌,建议会很好。
I'm looking for some advice about authorization for a request I'm making in Power Automate Desktop using the action 'Invoke Web Service'. I'm using this request to get information from Dataverse.
I've currently set up this request using OAuth2.0 with the Grant Type set to Implicit and I've hardcoded a token value into the header. I'm pretty green when it comes to authorization, so I'm just wondering if that's the best way to use OAuth2.0 to get info from Dataverse to PAD? I'm also concerned this token will expire and how to go about handling that. If I should set this up differently please let me know. And if you know how I can refresh the token automatically somehow, advice would be great.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我将假设您的组织内有一个 Azure 实例。
您应该能够通过 PAD 执行整个 OAuth 流程,因为您可以通过 Postman 执行...
https://learn.microsoft.com/en-us/powerapps/developer/data-platform/webapi/use-postman-web-api
...有说过,如果您想要一种更简单的方法,我的建议是使用 LogicApps,因为它会为您完成所有艰苦的工作。它还可以保护密钥等,如果这些密钥包含在 PAD 流中,则存在暴露风险,即使您将此类信息存储在 KeyVault 或其他内容中也是如此。在某些时候,它需要暴露于 PAD。
您可以创建一个由传入 HTTP 请求触发的 LogicApp ...
...并让您的 DataVerse 连接器提取相关数据...
...然后返回到调用 PAD 流程响应动作。
这是一个示例流程...
鉴于您的问题缺乏有关过滤等的具体信息,我没有详细介绍。但是您始终可以通过在有效负载中添加订购、过滤等功能来使您的 LogicApp 更加全面。在 OData 调用上展开等到 DataVerse,以便您从数据角度准确获得所需的内容。
I'm going to make the assumption that you have an Azure instance within your org.
You should be able to execute the entire OAuth flow through PAD given you can do it through Postman ...
https://learn.microsoft.com/en-us/powerapps/developer/data-platform/webapi/use-postman-web-api
... having said that, if you want an easier way, my suggestion would be to use LogicApps as it does all of the hard work for you. It will also protect keys, etc. that run the risk of being exposed if contained within a PAD flow and that's even if your store that sort of information in a KeyVault or something. At some point, it needs to be exposed to PAD.
You can create a LogicApp that's triggered by an incoming HTTP request ...
... and have your DataVerse connector pull the relevant data ...
... to then return back to the calling PAD flow with a response action.
This is an example flow ...
I haven't gone into detail given your question lacks specifics around filtering, etc. but you can always make your LogicApp more comprehensive by adding functionality in the payload to order, filter, expand, etc. on the OData call to DataVerse so you get exactly what you want from a data perspective.