简体   繁体   English

Microsoft Graph - 获取 Outlook 日历事件 - 403 Forbidden

[英]Microsoft Graph - get Outlook Calender events - 403 Forbidden

I tried to receive all events for an Microsoft 365 User.我尝试接收 Microsoft 365 用户的所有事件。 It's a business license and a add an App with all User/Mail/Calendar Permissions (also consent granted) to Api permissions.这是一个营业执照,并添加一个具有所有用户/邮件/日历权限(也已同意)到 Api 权限的应用程序。

When running this command or some similar like in the documentation I got 403运行此命令或文档中的类似命令时,我得到 403

Client error: `GET https://graph.microsoft.com/v1.0/users/xxxxxxxxxxxxxxxxxxxx/events` resulted in a `403 Forbidden` re  
  sponse:                                                                                                                                  
  {"error":{"code":"ErrorAccessDenied","message":"Access is denied. Check credentials and try again."}}

What did I do wrong?我做错什么了? I also tried the Graph Explorer (with logged in user).我还尝试了 Graph Explorer(登录用户)。

Are the permissions you are assigning delegated or application permissions?您分配的权限是委托权限还是应用程序权限?

If you are using application permissions for your App Registration then you need to give access on the user's calendar to the app (probably by using a new service principal on exchange online).如果您正在使用应用程序注册的应用程序权限,那么您需要在用户的日历上授予该应用程序的访问权限(可能通过在线交换使用新的服务主体)。

If you are using delegated permissions then you should check the access token you are getting for validation in jwt.ms如果您使用的是委派权限,那么您应该在 jwt.ms 中检查您获得的访问令牌以进行验证

Bear in mind that Graph explorer with logged in user needs different permissions than your App Registration.请记住,具有登录用户的 Graph 资源管理器需要与您的应用程序注册不同的权限。 ( it's a different app registration altogether ) (这完全是一个不同的应用程序注册)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Microsoft Graph API:Httpclient 403 Forbidden 错误 - Microsoft Graph API: Httpclient 403 Forbidden error Microsoft Graph API 随机返回 403 - Forbidden - Microsoft Graph API randomly returns 403 - Forbidden 使用 MS Microsoft Graph 按类别获取和过滤 Outlook 事件 - Get and Filter Outlook events by Category using MS Microsoft Graph 通过 Microsoft Graph 观察 Outlook 事件 - observing the outlook events via Microsoft Graph Microsoft Graph Api Beta DriveItem extractSensitivityLabel 返回 403 Forbidden - Microsoft Graph Api Beta DriveItem extractSensitivityLabel returns 403 Forbidden Microsoft Graph API /me/people 403 禁止错误 - Microsoft Graph API /me/people 403 forbidden error 获取 /v1.0/me 时 Microsoft Graph 403 Forbidden - Microsoft Graph 403 Forbidden when getting /v1.0/me Microsoft365R get_business_outlook:“禁止访问 (HTTP 403)。无法完成操作。消息:权限不足,无法完成操作。” - Microsoft365R get_business_outlook: "Forbidden (HTTP 403). Failed to complete operation. Message: Insufficient privileges to complete the operation." 禁止使用 Microsoft Graph - Forbidden Microsoft Graph Microsoft Oauth2 403 禁止 - Microsoft Oauth2 403 Forbidden
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM