I am using the GraphServiceClient in my code to access multiple endpoints for data. I have a service account who logs in with Azure AD, with the following scopes: Group.Read.All, User.Read.All, Mail.Read.
However, with these needed scopes I cannot get the MailFolders for a users profile or a birthdate from the user. It gives the following error:
ServiceException: Code: -2147024891, System.UnauthorizedAccessException.
The delegated permissions in Azure AD have already granted by admin (https://imgur.com/iFb0rx9).
Example MailFolders:
var result = await client
.Users[user.Id]
.MailFolders
.Request()
.GetAsync();
This is the error that came back:
ServiceException:
Code: ErrorAccessDenied
Message: Access is denied. Check credentials and try again.
Can I not access other users profiles or am I missing something else?