如何从 MS Graph 中的私人用户获取完整令牌? [英] How do I get a full token from a private user in MS Graph?

查看:29
本文介绍了如何从 MS Graph 中的私人用户获取完整令牌?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 jwt.io 中检查收到的用户的令牌 - https://i.imgur.com/S5BzmbS.png来自组织目录中的帐户 - https://i.imgur.com/yGq2RM7.png

I check the token from the received user in jwt.io - https://i.imgur.com/S5BzmbS.png From account in organizational directory - https://i.imgur.com/yGq2RM7.png

AD 中的权限应用 - https://i.imgur.com/oMlqlqx.png

Permissions app in AD - https://i.imgur.com/oMlqlqx.png

用户通过此说明获取令牌 - https://github.com/OfficeDev/msteams-tabs-sso-sample-nodejs

User get token by this instructions - https://github.com/OfficeDev/msteams-tabs-sso-sample-nodejs

主要问题显然是因为令牌的原因,当发送请求/me/drive/root/children时,私人用户收到一个空值.

The main problem is that apparently because of the token, when sending a request /me/drive/root/children, the private user receives an empty value.

推荐答案

var scopes = ["https://graph.microsoft.com/User.Read"]; 修改为 var scopes = ["https://graph.microsoft.com/.default"];这一行.

Modify var scopes = ["https://graph.microsoft.com/User.Read"]; to var scopes = ["https://graph.microsoft.com/.default"]; in this line.

然后访问令牌将包括所有授予的 Microsoft Graph 权限.

Then the access token will include all the granted Microsoft Graph permissions.

这篇关于如何从 MS Graph 中的私人用户获取完整令牌?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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