ms Graph api,calendarView 403-accessdenied 错误

ms Graph api, calendarView 403-accessdenied error

首先,我正在使用 Spring、Jetty、Retrofit。

当我在本地使用 calendarView 时,它们 return 成功的值。

但是,当其他人连接到我的本地服务器并调用此 api 时,它总是 return 给我 403-AccessDenied 错误。 (此外,当他们调用另一个 ms api 时,他们 return 成功的值。)

我想我已经在 Graph api 中设置了所有推荐的权限。 但这可能是我的错觉。

为了让其他人从我的本地服务器调用 api,我应该怎么做?

或者我在这件事上遗漏了什么吗?

这些是我的权限。

"openid",
"offline_access",
"profile",
"User.ReadWrite",
"Mail.ReadWrite",
"Calendars.ReadWrite",
"User.ReadBasic.All",
"BookingsAppointment.ReadWrite.All"

这是我的 azure 信息。

我正在使用这个日历视图 api

https://docs.microsoft.com/en-us/graph/api/calendar-list-calendarview?view=graph-rest-1.0&tabs=http

并在我的代码中使用此 URL(在本例中,我使用的是批处理请求)

GET | "/users/"+getAddress()+"/calendarView?startDateTime="+getStartTime()+"&endDateTime="+getEndTime()

根据您的描述,其他用户正在尝试访问用户“{Room}”的日历视图。

在这种情况下,您还需要2个配置。

  1. 用户“{Room}”将邮箱权限 "Full Access" 授予其他用户 在 Office 365 中。请参阅 使用 EAC 将权限分配给个人 邮箱。 (你应该可以找到下面的房间 资源。该过程最多可能需要数小时才能使更改在系统中传播并生效。)
  2. 再添加一项委托权限:Calendars.ReadWrite.Shared 到 在 Azure AD 中注册的应用程序。