gpt4 book ai didi

authentication - Power BI - 以编程方式登录

转载 作者:行者123 更新时间:2023-12-04 17:59:56 24 4
gpt4 key购买 nike

我正在尝试编写一个嵌入一些 Power BI 报告的网络应用程序。数据在本地,因此我无法使用可用的新解决方案 (Power BI Embedded)。现在使用旧方法 (https://powerbi.microsoft.com/en-us/documentation/powerbi-developer-integrate-a-power-bi-tile-or-report/) 的不便之处在于,网页的使用者需要是 Power BI 用户,需要登录才能让 Web 应用程序最终获得身份验证 token (有一对之前需要发生的页面重定向)。所以我的问题是,有没有办法以编程方式进行 Power BI 登录?这样我就可以只使用一个 Power BI 帐户来获取内容。

最佳答案

我也在那边做实验,这个线程帮助我做到了这一点(见帖子 #8):

http://community.powerbi.com/t5/Developer/How-to-use-Power-BI-Rest-API-without-GUI-authentication-redirect/m-p/14218#

基本上:

POST 请求到: https://login.microsoftonline.com/common/oauth2/token

正文,表单 url 编码:

  • grant_type: "密码"
  • 作用域:“openid”
  • 资源:“https://analysis.windows.net/powerbi/api
  • client_id:您的客户编号
  • client_secret:您的客户 secret
  • 用户名:那个用户名
  • 密码:该用户名密码

然后直接拿到token。

此外,考虑此处所述的安全问题可能会很好:http://www.cloudidentity.com/blog/2014/07/08/using-adal-net-to-authenticate-users-via-usernamepassword/在“何时不使用此功能”下

关于authentication - Power BI - 以编程方式登录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36726393/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com