1
votes

I am writing a UWP program that uses MS Graph to get users mail folders and then messages.

I acquire an access token using my credentials while I am admin in Azure AD and Office 365. calling this with my id = my alias it is working right. var mailFoldersPage = await graphClient.Users[id].MailFolders.Request().GetAsync();

But calling it while id = someone else alias give me MS Graph ServiceException Code: ErrorAccessDenied Message: Access is denied. Check credentials and try again.

Can someone help me out?

thanks Mohamed Hassanin

1

1 Answers

0
votes

Delegated Mail permissions do not provide access another user's mailbox unless it has been explicitly shared with your account.

In order to access any user's mailbox, you would need to use Application Mail permissions. These are acquired using the Client Credentials grant.