0

My requirement to show all the calendar events of my wishlisted user in my Canvas App. To access the graph API, I have done App registration in AAD with Calendar.Read and User.Read permission.

Using the Client and Secret received from the registered app, Power Apps Custom Connector is created. While Testing the Custom Connector, I am getting the below error.

{ "error": { "code": "ErrorAccessDenied", "message": "Access is denied. Check credentials and try again." } } enter image description here On Analysis:

Scenario 1 : Calendar.Read - Delegated Permission Type

Api - https://graph.microsoft.com/v1.0/users/{UserID}/events

enter image description here

When Delegated permission is given , I am able to access and response from the calendar event API only when the UserID is mine.

But it is throwing the above mentioned error for other users (This is the actual requirement)

Scenario 2 : Calendar.Read - Application Permission Type

Api - https://graph.microsoft.com/v1.0/users/{UserID}/events

enter image description here

When Application permission is given , it is failing and throwing the same error.

  1. First, Will I be able to get other user's calendar event?
  2. What are the steps to be taken to access?
  3. What permission type should be considered for my scenario?
  4. Am I missing any basic settings?

Please advice. I have lost my time for this requirement.

Thanks in advance

1 Answer 1

1

If you where to use Delegates permission (which sounds wrong for the authentication flow you want to use) then to access another users calendar (that you have been delegated rights to either via Outlook or the Mailbox Permissions) you will need (Calendars.Read.Shared or Calendars.ReadWrite.Shared) see https://learn.microsoft.com/en-us/graph/outlook-get-shared-events-calendars

For the client credentials flow https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow which it sounds like what you want to use ? then the Calendar.Read should be enough to access the calendar if your doing anything else in the Directory then User.Read will also need to be an application permission. You probably need to look at https://support.microsoft.com/en-us/topic/verifying-oauth-configuration-for-custom-connectors-d733fdb9-6108-4199-b4f5-06e99b02d10f to do some debugging to see what actually happening with your token generation process, you can the use something like jwt.io to check the correct scopes etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.