Power BI ADAL身份验证

时间:2017-06-28 18:06:29

标签: android azure active-directory powerbi adal

您好我正在尝试使用Power BI API与Android但我遇到了一些麻烦

我已经完成了Azure活动目录身份验证

登录后我得到类似的东西

06-28 13:00:20.463 6274-6274/telmex.blitz.com.telmexpowerbi D/LoginPowerBI: ID Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJub25lIn0.eyJhdWQiOiIyYTMzOWZiMy0xM2M0LTQxZjktODMyZS0....
06-28 13:00:20.463 6274-6274/telmex.blitz.com.telmexpowerbi D/LoginPowerBI: Access Token: eyJ0eXAiOiJKV1QiLCJub25jZSI6IkFRQUJBQUFBQUFCbmZpRy1tQTZOVGFlN0NkV1c3UWZkSkVncDBz...
Expires On: Wed Jun 28 14:00:19 CDT 2017

所以我正在使用改造来使用Power BI API

header --> callReports.request().header("Authorization: Bearer "+accessToken);

但是当我想要获得我的报告时

raw response --> Response{protocol=http/1.1, code=403, message=Forbidden, url=https://api.powerbi.com/v1.0/myorg/reports}

权限

PowerBI Permissions

我已经拥有PowerBI并登录并以登录用户权限

的身份访问该目录

我还需要什么,或者我做错了什么?

1 个答案:

答案 0 :(得分:0)

根据您的错误代码&资源网址,我认为问题是由于您在执行阅读报告请求时遗漏了所需的权限,403代码的可能原因如下图所示here

enter image description here

因此,您需要通过Azure门户和PowerBI检查并添加所需的权限,如下所示。

  1. 在Azure门户网站上,在您注册的Azure AD应用的设置标签中添加Power BI service权限,请参阅下图
  2. enter image description here

    1. 按照文档Register an app to embed Power BI contentRegister with the Power BI App Registration Tool部分的第6步检查并添加所需的Power BI权限。
    2. 然后再试一次。希望它有所帮助。