cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
cgru3eejc2
Level: Powered On

Send mail as user via Graph API (app registration) with delegated permission

Hi,

I'm trying to implement a Logic App (or Flow) which can send e-mails in the name of the caller (another user). So a user calls a Flow or Logic app we built with an own Flow. So the user is known and his access token could be “transferred”.

When I create an app (App registration) with application permission for the Graph Mail.Send API this works.

 

With delegated permission I did not succeed to implement it.

 

Even when getting the OAuth token first for the caller user I only get a NoPermissionsInAccessToken when calling the App to send.mail via Graph API:

"code": "NoPermissionsInAccessToken",

"message": "The token contains no permissions, or permissions can not be understood.",

 

Found this blog where similar behavior is mentioned and the alternatives are not really possible or good.

https://stackoverflow.com/questions/56495738/retrieve-oauth-2-0-authorization-code-without-user-inte...

 

Do you have any hint how to implement a generic "Send As" in delegation of a user with Flow or Logic Apps (not using a shared mailbox and give send as permission).

Is application permission really the only way?

 

Regards,

Stefan

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Send mail as user via Graph API (app registration) with delegated permission

Hi @cgru3eejc2,

 

Yes, you can create other connections in the Flow. For instance, you could create a Flow with multiple Email connection, then email will send as the connection account.

Annotation 2019-09-16 165705.png

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 REPLIES 3
Community Support Team
Community Support Team

Re: Send mail as user via Graph API (app registration) with delegated permission

Hi @cgru3eejc2,

 

I am afraid you could not use the Graph API to send an email on behalf of others, you will only be able to send emails from an email account that you have been given delegate access to.

Please refer to the following document:

https://docs.microsoft.com/en-us/graph/permissions-reference#mail-permissions

Annotation 2019-09-16 153522.png

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

cgru3eejc2
Level: Powered On

Re: Send mail as user via Graph API (app registration) with delegated permission

Thanks @v-litu-msft

 

Is it the same for Mail.Send?

 

So otherwise it can only be done via app permission?

 

Regards,

Stefan

Community Support Team
Community Support Team

Re: Send mail as user via Graph API (app registration) with delegated permission

Hi @cgru3eejc2,

 

Yes, you can create other connections in the Flow. For instance, you could create a Flow with multiple Email connection, then email will send as the connection account.

Annotation 2019-09-16 165705.png

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Users Online
Currently online: 398 members 4,839 guests
Please welcome our newest community members: