Hi everyone! I am setting up an n8n workflow to read/send emails from a shared mailbox using an existing Azure App Registration.
Currently, n8n uses the Microsoft Graph Delegated permissions OAuth flow, which links the connection to my personal account. To make this automation sustainable for the whole team, is there a standard way to connect to Outlook without using personal credentials?
Can we provision a generic Service Account with access to the shared mailbox?
Or can we switch the Azure App to Application Permissions, restricted to just this mailbox via an Application Access Policy?
Any guidance on the standard IT process for this would be great. Thanks!
Yes, but make a dedication non personal account, give it access to the shared mailbox, and connect n8n to it with use shared inbox on. A downside is its still a signed in user so it needs a license, and can break with 2fa.
This is the better option, switch the azure app to app permissions Mail.ReadWrite + Mail.Send with admin consent/permissions. n8n supports this too
Okay so once I set the Application permissions in Azure AD with admin consent, I have to setup Outlook Oauth 2 credential with the shared mailbox ON. So lets say I left the company. Will the flow continue to run seamlessly after that?
So what I have done is, I have created a shared mailbox and new Azure App registration with Application Permissions for mail.ReadWrite and Mail.send (Admin Consent is yet to be approved). Now in n8n, I have created a OAuth2 API credential with client credentials of azure app. From n8n I can send Http request to https://graph.microsoft.com/v1.0/users//messages?$top=5 to get the emails.
Am I going into right direction or still complicating the things?