php - Azure 访问 token 始终返回 401

标签 php azure drupal azure-active-directory powerbi-embedded

我已从 https://login.microsoftonline.com/tenentid/oauth2/token 获得访问 token - 使用 grant_type=client_credentials

现在,当我尝试从 https://api.powerbi.com/v1.0/myorg/groups/gid/reports/rid/GenerateToken 获取嵌入 token 时它总是返回 401 未经授权。

有谁知道为什么会这样吗?

最佳答案

确保您正在针对 PowerBI 受众进行身份验证,您可以在“aud”属性中的 token 解码中看到它。

401(未经授权)表明颁发 token 的机构不正确,或者权限冲突。 确保您拥有“Bearer XXX” token ,其中 XXX 是您的访问 token 。

还要确保您拥有正确的组和报告 ID(这种情况经常发生:))

关于php - Azure 访问 token 始终返回 401,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48099451/

相关文章:

php - 如何在 Laravel Eloquent 中对同一个表进行子查询

azure - 如何仅将选定的 NuGet 包从 Azure Pipeline 发布到 Artifactory?

c# - 如何在 Azure Function 启动时仅连接到 Cosmos DB 一次?

mysql - MariaDB 启动时出错,不断重新启动

javascript - noConflict JQuery 的 Drupal 问题

docker - 在Docker上设置Varnish + Drupal

php - 缺少 mysqli 扩展。请检查您的 PHP 配置

php - 如果服务器上存在文件,则转到页面

php - 使用命令行从书中运行 php 脚本

AzureIoTHub : How to send telemetry data in JSON format?