PowerBI Accces令牌上的无效授予 [英] Invalid Grant on PowerBI Accces token

查看:142
本文介绍了PowerBI Accces令牌上的无效授予的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用ASP.NET Core 2.0嵌入Power BI报表和仪表板.由于UserPasswordCredential在Core中不起作用,因此我正在使用API​​获取访问令牌.但是,我收到invalid_grant错误. 400错误的请求.

用户名和密码是正确的,因为我在MVC应用程序中使用了该用户名和密码,并且该用户名和密码可以正常工作. {

    错误":"invalid_grant",
    "error_description":"AADSTS70002:验证凭据时出错. AADSTS50126:无效的用户名或密码\ r \ n跟踪ID:d1c17227-cc20-4520-a60f-f71ffa252a00 \ r \ n相关ID:f025317-1ebd-43d4-84e4-422ffad6f833 \ r \ n时间戳:2018-10-10 19:57:41Z,
    "error_codes":[
        70002,
        50126
    ],
    " timestamp" ;:" 2018-10-10 19:57:41Z" ;,
    "trace_id":"d1c17227-cc20-4520-a60f-f71ffa252a00",
    "correlation_id":"f0254317-1ebd-43d4-84e4-422ffad6f833"
}

POST:  https://login.microsoftonline.com/common/oauth2/token

内容类型: application/x-www-form-urlencoded

grant_type:密码

scope:openid

资源:

用户名:myusername

密码:mypassword

解决方案

可以确定是否使用了授予权限"提供对Power BI服务的适当权限.另外,您是否要传递PowerBI主用户帐户名和密码.你能通过Power BI吗 文档,并检查所有设置是否正确.


I'm try to embed Power BI reports and dashboards using ASP.NET Core 2.0.  Since UserPasswordCredential does not work in Core, I'm using the API to get the access token.  However, I'm getting invalid_grant error. 400 bad request.

The username and password is correct since I'm using the same with my MVC app and it is working.  {

    "error": "invalid_grant",
    "error_description": "AADSTS70002: Error validating credentials. AADSTS50126: Invalid username or password\r\nTrace ID: d1c17227-cc20-4520-a60f-f71ffa252a00\r\nCorrelation ID: f0254317-1ebd-43d4-84e4-422ffad6f833\r\nTimestamp: 2018-10-10 19:57:41Z",
    "error_codes": [
        70002,
        50126
    ],
    "timestamp": "2018-10-10 19:57:41Z",
    "trace_id": "d1c17227-cc20-4520-a60f-f71ffa252a00",
    "correlation_id": "f0254317-1ebd-43d4-84e4-422ffad6f833"
}

POST: https://login.microsoftonline.com/common/oauth2/token

Content-Type: application/x-www-form-urlencoded

grant_type: password

scope:openid

resource:https://analysis.windows.net/powerbi/apiclient_id: myclientid

username: myusername

password: mypassword

解决方案

Can you make sure if you have used the "Grant Permissions" to provide proper permissions to Power BI Service.  Also, are you passing the PowerBI master user account name and password.  Can you go through Power BI documentation and check if you are setting everything correctly.


这篇关于PowerBI Accces令牌上的无效授予的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆