Delegated permission - Send email with Microsoft Graph

juan maximiliano aguilar abanto 521 Reputation points


I use application permissions to obtain a valid token to send a email with Microsoft Graph.

I followed the link:
But, i want to use delegated permissions.. adding parameters when I get the token


Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
14,770 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. soumi-MSFT 11,651 Reputation points Microsoft Employee

    @juan maximiliano aguilar abanto , You can go ahead and request a token from AAD for an user using the Authorization Code Grant Flow (using OAUTH 2.0). You can floow the steps below to create a request to obtain the code as well as the token and then utilise the token to perform activities using the Graph API.


    • Create a request to obtain the code from Azure AD by sending the request to the /authorize endpoint:{tenantName/tenantId}/oauth2/v2.0/authorize?client_id={applicationId}&response_type=code&redirect_uri={redirect_uri}&response_mode=fragment&scope=openid User.Read&state=12345

    Note: Here in the scope parameter you can mention the delegated permissions that you would want to be present in the access token. for eg: here I have mentioned the scope as openid User.Read. For your requirement you can keep adding other delegated permissions into the scope parameter, with a space in between.

    • When you send this request, AAD, asks you to authenticate yourself and after authentication you would get a response similar to
    • Copy the code section from the response and then make the next call to the /token endpoint of AAD asking for an access token. [Refer to the screenshot below] 3461-authcodeflow.png
    • Once you send the request to the /token endpoint of AAD, it would provide you with an access token. 3432-accesstoken-new.png You can check for the mentioned scopes/permissions in the Access token by decoding the token using
    • Once done, you can make the Graph API call next. To do that you need to copy this access token and send it along with the Graph API call as Bearer in the header of the request. [Refer to the screenshot below:] 3433-graphcall.png

    Hope this helps. If the above response helped you in answering your query, please do mark the response as "answered" so that it helps others too.