15-11-23 08:20 AM
15-11-23 04:31 PM
In Microsoft Graph, you have two main types of authentication:
Application Access Token: Used when your application needs to access resources on behalf of itself, not on behalf of a specific user. This method is often used for background services or daemons.
Delegated Access Token: Used when your application needs to access resources on behalf of a user. This means the user's permissions are taken into account, and the application can only do what the user is allowed to do.
For reading and writing emails using Microsoft Graph in Azure, you'll need to set the following permissions:
For Application Permissions (without a signed-in user):
Mail.ReadWrite - Allows the app to read, update, create, and delete email in all mailboxes without a signed-in user.
Mail.Send - Allows the app to send mail as any user without a signed-in user.
For Delegated Permissions (on behalf of a signed-in user):
Mail.ReadWrite - Allows the app to read, update, create, and delete the signed-in user's email.
Mail.Send - Allows the app to send mail as the signed-in user.
Use the Microsoft Authentication Library API, MSAL to acquire the access token to Microsoft Graph.