Access mails from shared mailbox using Microsoft Graph API with least priviledges

Ravindra Shukla 121 Reputation points
2021-05-14T07:51:02.563+00:00

Hello,

I have a requirement related to Microsoft Graph API where I need to access the emails from a shared mailbox using microsoft graph, but with delegated permissions. Like I need to use azure ad application ID and use my user credentials(username/password) to authenticate and retrieve the mails from shared mailbox using microsoft graph api.

I cannot use application permissions due to the security reasons in my organization.

What is the best approach to implement this kind of scenario, also whether this is possible.

Please suggest.

Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Danstan Onyango 3,906 Reputation points Microsoft Employee
    2021-05-17T08:08:49.73+00:00

    See Get Outlook messages in a shared or delegated folder to help you achieving this. Note that your app will need to request for access token using delegated permissions Mail.Read.Shared or Mail.ReadWrite.Shared to call GET /v1.0/users/share-mailbox-upn/mailFolders depending on whether you need write access. At the minimum you will need Mail.Read.Shared

    You can do this using a Single Page Application, checkout Microsoft identity platform and OAuth 2.0 authorization code flow through which you can get an access token with one of the above scopes and read mails.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.