小编Div*_*e R的帖子

AccessDenied,令牌中需要存在 scp 或角色声明

使用这个 URI 我试图生成访问令牌

https://login.microsoftonline.com/<tenant_id>/oauth2/v2.0/token
Run Code Online (Sandbox Code Playgroud)

并且成功生成了访问令牌。

我正在传递 client_id、client_secret、grant_type 和范围。

当我尝试检查https://jwt.io/#encoded-jwt 时, 我发现它的签名无效。

当我尝试通过执行以下调用访问此站点时

https://graph.microsoft.com/beta/sites/<tenant_id>/lists
Run Code Online (Sandbox Code Playgroud)

使用这些访问令牌,我收到以下错误:“AccessDenied,令牌中需要存在 scp 或角色声明。”

{
    "error": {
        "code": "AccessDenied",
        "message": "Either scp or roles claim need to be present in the 
                    token.",
        "innerError": {
            "request-id": " ",
            "date": " "
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

为了访问该站点并以 application/json 格式获取列表,请建议应包含哪些内容以获取令牌中的角色声明?

sharepoint azure postman microsoft-graph-api

5
推荐指数
1
解决办法
4293
查看次数

标签 统计

azure ×1

microsoft-graph-api ×1

postman ×1

sharepoint ×1