我如何从 MS Graph 中的私人用户那里获得完整的令牌?
How do I get a full token from a private user in MS Graph?
我检查了 jwt.io 中收到的用户的令牌 - https://i.imgur.com/S5BzmbS.png
来自组织目录中的帐户 - https://i.imgur.com/yGq2RM7.png
AD 中的权限应用程序 - https://i.imgur.com/oMlqlqx.png
用户通过此说明获取令牌 - https://github.com/OfficeDev/msteams-tabs-sso-sample-nodejs
主要问题显然是因为令牌,在发送请求时 /me/drive/root/children
,私人用户收到一个空值。
在this line中将var scopes = ["https://graph.microsoft.com/User.Read"];
修改为var scopes = ["https://graph.microsoft.com/.default"];
。
然后访问令牌将包括所有授予的 Microsoft Graph 权限。
我检查了 jwt.io 中收到的用户的令牌 - https://i.imgur.com/S5BzmbS.png 来自组织目录中的帐户 - https://i.imgur.com/yGq2RM7.png
AD 中的权限应用程序 - https://i.imgur.com/oMlqlqx.png
用户通过此说明获取令牌 - https://github.com/OfficeDev/msteams-tabs-sso-sample-nodejs
主要问题显然是因为令牌,在发送请求时 /me/drive/root/children
,私人用户收到一个空值。
在this line中将var scopes = ["https://graph.microsoft.com/User.Read"];
修改为var scopes = ["https://graph.microsoft.com/.default"];
。
然后访问令牌将包括所有授予的 Microsoft Graph 权限。