0
votes

I have created an account in the Office 365 trial. I've added the New App Registration on Azure with permissions:

BookingsAppointment.ReadWrite.All 
Calendars.ReadWrite
Contacts.ReadWrite 
EWS.AccessAsUser.All
Mail.ReadWrite 
Mail.Send 
People.Read 
User.Read 
User.ReadBasic.All

And when I call https://graph.microsoft.com/v1.0/me/people as the user who created the office account gets a full list of users and resources.

When I call as a created user by admin with administrator rights, I get an empty list. I call permission link on admin user and on created admin user:

https://login.microsoftonline.com/{}/oauth2/v2.0/authorize?client_id={}&response_type=code&scope=BookingsAppointment.ReadWrite.All%20Calendars.ReadWrite%20Contacts.ReadWrite%20EWS.AccessAsUser.All%20Mail.ReadWrite%20Mail.Send%20People.Read%20People.Read%20User.Read%20User.ReadBasic.All

What is wrong?

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('fb6b188c-8698-4a03-9da4-82b7479c4625')/people",
    "value": []
}
1

1 Answers

0
votes

For a user (lets call it Admin in your case) to be able to access another users contacts folder using the delegate grant would require Contacts.Read.Shared or Contacts.ReadWrite.Shared see https://docs.microsoft.com/en-us/graph/outlook-get-shared-contacts-folders .

The other thing is that Admin rights have no meaning to mailbox access eg Delegate Access to mailboxes all needs to be specifically granted either via Add-MailboxPermission https://docs.microsoft.com/en-us/exchange/recipients/mailbox-permissions?view=exchserver-2019 or delegate through Outlook. (eg if you can access the target mailbox through OWA or Outlook your Exchange rights are good but just being a Tenant Admin means in regards to mailbox access). Your other option is if your trying to create an app that is going to access all mailboxes in a tenant look at app only tokens https://docs.microsoft.com/en-us/azure/active-directory/develop/scenario-daemon-app-registration