[英]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 )
(这完全是一个不同的应用程序注册)
Seems like I had the same issue https://learn.microsoft.com/en-us/answers/questions/1165285/microsoft-graph-get-outlook-calendar-events-403?page=1&orderby=Helpful&comment=answer-1168253#newest-answer-comment好像我有同样的问题https://learn.microsoft.com/en-us/answers/questions/1165285/microsoft-graph-get-outlook-calendar-events-403?page=1&orderby=Helpful&comment=answer-1168253 #newest-answer-评论
The fix was to remove all the other permissions and just give it解决方法是删除所有其他权限并只给它
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.