Using n8n cloud with Microsoft Oauth2

Describe the problem/error/question

I’m using n8n cloud. I need to connect to a client’s outlook mail. The client created an email-account that I have access to. But when I try to create a “Microsoft Outlook Oauth2 Api” credential, I get the ‘Need admin approval’ message. I’m guessing this is because the application is not registered with the Microsoft platform and so the client is trying to register an application following the steps mentioned in the documentation. However, the step #5 requires an OAuth Callback URL and I can’t find a way to get this URL so I can pass it on to them. How can I find this info ?

Also registering the application is not the right way to fix the problem, please advice.

Apologies if this information is common. I”m fairly new and couldn’t find it in any other posts. (Most of them talk about the self hosted use-case)

What is the error message (if any)?

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8nCloud
  • Operating system:

The OAuth Callback URL is as follows:

https://targetinstance.app.n8n.cloud/rest/oauth2-credential/callback

If self-hosting your n8n instance:

https://base-url-of-your-server/rest/oauth2-credential/callback

However, if the email you are using is part of an organization & doesn’t have cloud developer permissions, you will also face this issue. If this is the case, login with an email that has permissions or let the client login and create credentials on their own(if they are an owner of their organization).

1 Like

Thank you @Mookie_Lian . I’ll pass on the info and see if that works. :folded_hands:

1 Like

You’re welcome, if that solves your issue you can mark as answer.

If it doesn’t, reply to this thread to see if I can help further.

Is your client using https://outlook.live.com/ (personal) or https://outlook.office.com/ (work/school).
If you are using personal Outlook, you can create an app by going to portal.azure.com with the personal Outlook account. (you have to make the app for ‘your own tenant’ only)

The client is using https://outlook.office.com/ for work.

Only setting the OAuth Callback URL in the application registration setup didn’t allow me to connect and gave me the same error saying - ‘Need admin approval’.
I had one of the admin’s login from my computer “Using the link that says - Have an admin account ? Sign in with that account”. That allowed me to create the Oauth credentials.

But unfortunately, I still get an error while using the ‘Microsoft Outlook node’ to connect to the client’s outlook mail that says -
{ "error": { "code": "MailboxNotEnabledForRESTAPI", "message": "The mailbox is either inactive, soft-deleted, or is hosted on-premise." } }
(I shall post another question specific to that)

But as far as creating the Oauth2 credential goes, this helped. I’m marking the answer as correct. Thank you

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.