what grant type/flow to use for a daemon app registration with Mail.ReadWrite delegated permission to get to inbox

sheida sadrai 1 Reputation point
2022-10-26T16:52:30.153+00:00

I need to access to one particular daemon email box that the AD granted delegated permission to Mail.ReadWrite.
What flow I need to use because the token created by client_credentials flow seems not working with delegated access permission?
Also this authentication is not for a real online user to enter user and pass. it is going to be accessed programatically to read from an exchange server inbox folder.
what grant type/flow to use for a daemon app registration with Mail.ReadWrite delegated permission to get to inbox
Thanks
Sheida

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
17,608 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Shweta Mathur 22,961 Reputation points Microsoft Employee
    2022-10-31T08:07:39.26+00:00

    Hi @sheida sadrai ,

    Thanks for reaching out.

    I understand you are trying to grant delegated permission to access one particular email box using daemon applications.

    For daemon application, where you don't want user to explicitly sign-in, you can use client credentials grant flow but there is no option to use delegated permission with daemon applications.

    However, there is an option to use application permission to specific mailbox, which limit application permission to specific Exchange Online Mailboxes by using by using the New-ApplicationAccessPolicy.

    Application access policy restricts mailbox access for apps that have been granted any of the Microsoft Graph or Exchange Web Services permission scopes that the policy supports.

    Reference : https://learn.microsoft.com/en-us/graph/auth-limit-mailbox-access

    Hope this will help.

    Thanks,
    Shweta

    ----------------------------------------------

    Please remember to "Accept Answer" if answer helped you.

    0 comments No comments