Create Mailbox items using Graph and limit access to specific mailboxes

shockoQA-1 61 Reputation points
2022-07-21T11:48:39.113+00:00

I'm building an app that I would like to leverage to create mails in a mailbox in Exchange Online using this Graph API. How do I create an access token for it so that it can only action against specific mailbox? Would I create an app registration and grant certain API access then use an Exchange application restriction policy?

Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,171 questions
{count} votes

Accepted answer
  1. Andy David - MVP 157.4K Reputation points MVP Volunteer Moderator
    2022-07-21T12:34:31.773+00:00

    Yes, use an Exchange Application access policy and scope to the mailboxes you want to have access to
    https://learn.microsoft.com/en-us/graph/auth-limit-mailbox-access

    However:
    This only works for specific scopes, so in your case, you prob cant use this if you want to create mail
    223059-image.png

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. shockoQA-1 61 Reputation points
    2022-07-23T10:04:16.207+00:00

    So if I grant the application Mail.ReadWrite then as per here it should fall within that scope. Without the access restriction policy would the app have full access to all mailboxes as indicated by https://learn.microsoft.com/en-us/graph/auth-limit-mailbox-access which I find concerning! Security should be opt out not in!

    That said, thank you for taking he time to reply. Very much appreciated.

    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.