【问题标题】:Power BI angular1 authenticationPower BI angular1 身份验证
【发布时间】:2017-11-27 06:05:38
【问题描述】:

我正在尝试将 Power BI 集成到 angular 1 应用程序中。根据我的研究,我知道我必须遵循以下流程

  1. 验证用户并获取访问令牌
  2. 通过使用此令牌获取嵌入令牌

但我在第一步就被打动了。如何认证?

我已经对https://login.microsoftonline.com/common/oauth2/token进行了 API 调用

带参数:

grant_type:'密码', client_id:clientId, 资源:'https://analysis.windows.net/powerbi/api', 范围:'openid', 用户名:用户名, 密码:密码, client_secret : client_secret

我收到以下回复:

"error": "invalid_client",
"error_description": "AADSTS70002: Error validating credentials. AADSTS50012: Invalid client secret is provided.\r\nTrace ID: 51694a76-ebf8-4923-9a8c-2a1ad2e35600\r\nCorrelation ID: f25bedeb-7aa9-45db-a93f-d8dfd85d0f19\r\nTimestamp: 2017-11-27 06:02:56Z",
"error_codes": [
    70002,
    50012
],
"timestamp": "2017-11-27 06:02:56Z",
"trace_id": "51694a76-ebf8-4923-9a8c-2a1ad2e35600",
"correlation_id": "f25bedeb-7aa9-45db-a93f-d8dfd85d0f19"

我不知道我是否调用了正确的 API。参数中资源的用途是什么?

谁能帮忙!谢谢

【问题讨论】:

    标签: javascript angularjs authentication powerbi powerbi-embedded


    【解决方案1】:

    我可以通过以下paramshttps://login.windows.net/common/oauth2/token 发出发布请求来获取身份验证令牌

    grant_type,Client_id,resource,username,password

    同样从错误来看,您发送的client secrate 无效

    【讨论】:

    • params 中的资源是什么?
    • 你可以试试同样的https://management.azure.com/providers/Microsoft.PowerBI
    • 感谢您的回复。我在 azure 门户中的密钥下创建了新的 client_secret 并尝试过,现在我收到无效的资源错误
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-05
    • 1970-01-01
    • 1970-01-01
    • 2020-10-26
    相关资源
    最近更新 更多