microsoft-graph-explorer-v4 icon indicating copy to clipboard operation
microsoft-graph-explorer-v4 copied to clipboard

CalendarView returning 403 even though consented

Open ViKunneJoKaldeHamPalle opened this issue 2 years ago • 9 comments

Describe the bug When accessing https://graph.microsoft.com/v1.0/me/calendar/calendarView?startDateTime=2023-01-01&endDateTime=2023-01-26 from https://developer.microsoft.com/en-us/graph/graph-explorer the returned output is "Forbidden - 403 - 200ms. Either the signed-in user does not have sufficient privileges, or you need to consent to one of the permissions on the Modify permissions tab"

In the Modify permissions tab Calendars.Read and Calendars.ReadWrite are consentet.

If using the Get-MgUserCalendarView to access my own calendar the result is as expected. Accessing any other user in our tenant yields the same "Access is denied" result as from the Graph developer website.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'https://developer.microsoft.com/en-us/graph/graph-explorer'
  2. Insert 'https://graph.microsoft.com/v1.0/me/calendar/calendarView?startDateTime=2023-01-01&endDateTime=2023-01-26' into the Query window and press 'Run query'
  3. See output in 'Response preview'

Expected behavior It is expected that the output is a view of all calendar events in the given timeframe.

Screenshots Microsoft Graph website image

Powershell Module (Get-MgUserCalendarView) image

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: Chrome 109.0.5414.120

ViKunneJoKaldeHamPalle avatar Jan 26 '23 13:01 ViKunneJoKaldeHamPalle

Hey @ViKunneJoKaldeHamPalle. I have tested this endpoint and it's working for my tenant. It seems your tenant admin has restricted delegated access to the calendar information for client applications. You can try the endpoint with different credentials for a different tenant to see if the issue persists. Also, confirm with your tenant admin if there is restricted access to the calendar resources.

Onokaev avatar Jan 31 '23 09:01 Onokaev

Let me know if this helps

Onokaev avatar Jan 31 '23 09:01 Onokaev

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

ghost avatar Feb 10 '23 15:02 ghost

Hi @Onokaev Thanks for the reply and sorry for not getting back earlier.

You might be right with regards to an admin in my tenant. Do you know where this setting is set in the tenant? Just so I know where to look (and possibly, who to blame :P)

ViKunneJoKaldeHamPalle avatar Feb 10 '23 15:02 ViKunneJoKaldeHamPalle

Hey @ViKunneJoKaldeHamPalle. Follow these steps to check:

  • Log in to Azure portal

  • Select Azure Active Directory > Enterprise applications > Consent and permissions > User consent settings.

  • Check if there are restrictions on the User Consent settings tab

Onokaev avatar Feb 27 '23 17:02 Onokaev

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

ghost avatar Mar 03 '23 18:03 ghost

User consent for applications is set to Allow user consent for apps

Group owner consent for apps accessing data is set to Allow group owner consent for all group owners

Can a setting via Powershell limit Graph functionality?

ViKunneJoKaldeHamPalle avatar Mar 06 '23 07:03 ViKunneJoKaldeHamPalle

Hey @ViKunneJoKaldeHamPalle. We are still investigating this issue. I'll get back to you soon. Also, could you confirm if you are experiencing this issue with a different tenant?

Onokaev avatar Mar 22 '23 07:03 Onokaev

I had no problem in a test tenant.

ViKunneJoKaldeHamPalle avatar Mar 22 '23 07:03 ViKunneJoKaldeHamPalle