Forum Discussion
Terry1235
Sep 20, 2023Copper Contributor
How can we allow a user to send email from a page within our multi-tenant web app?
HI, we have a custom web application that is multi-tenant. What's the best way to allow a user to grant permission to our application to send emails on their behalf? We treked down the path of using ...
govindagoud
Oct 12, 2023Brass Contributor
This is a way to allow a user to grant permission to your application to send emails on their behalf is to use the Microsoft Graph API. The Microsoft Graph API is a unified endpoint for accessing data and services across Microsoft 365, including Outlook, OneDrive, SharePoint, Teams, and more. You can use the Microsoft Graph API to send mail from another user using the Outlook mail API1.
To use the Microsoft Graph API, you need to register your application in Azure Active Directory (Azure AD) and request the appropriate permissions. You can use either the delegated permissions or the application permissions to send mail on behalf of a user. The delegated permissions require the user to sign in and consent to the permissions requested by your application. The application permissions require an administrator to consent on behalf of all users in the tenant.
You can use the Microsoft identity platform to authenticate your application and acquire an access token to call the Microsoft Graph API. You can use various authentication flows depending on your application type and scenario. For example, you can use the authorization code flow for web applications, the implicit grant flow for single-page applications, or the client credentials flow for daemon or service applications.
To use the Microsoft Graph API, you need to register your application in Azure Active Directory (Azure AD) and request the appropriate permissions. You can use either the delegated permissions or the application permissions to send mail on behalf of a user. The delegated permissions require the user to sign in and consent to the permissions requested by your application. The application permissions require an administrator to consent on behalf of all users in the tenant.
You can use the Microsoft identity platform to authenticate your application and acquire an access token to call the Microsoft Graph API. You can use various authentication flows depending on your application type and scenario. For example, you can use the authorization code flow for web applications, the implicit grant flow for single-page applications, or the client credentials flow for daemon or service applications.