Microsoft Graph: Current authenticated context is not valid for this request

怎甘沉沦 提交于 2019-12-06 11:02:36

This exception is caused by the token acquired using the client credentials flow. In this flow, there is no context for Me.

To fix this issue, you need to specify the whose event you want to get. Or you need to provide the delegate-token.

code for your reference:

//var envens=await graphClient.Me.Events.Request().GetAsync();
var envens = await graphClient.Users["xxx@xxx.onmicrosoft.com"].Events.Request().GetAsync();
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!