Credentials error in integration with Microsoft Outlook

I’m facing issues while attempting to perform the action to read emails from a corporate account using Outlook.
I’ve already configured the credentials using OAuth as guided by the link ://docs.n8n.io/integrations/builtin/credentials/microsoft.

The only difference is that I used the configuration for a single tenant, so the Authorization and Access Token URLs require the tenant identifier, unlike the /common/ used in the multi-tenant guidance from the link

As shown in the image below, the configurations were successfully accepted. However, upon executing the action, I receive the 401 error as shown in the other image:
ERROR: Authorization failed - please check your credentials
CompactToken parsing failed with error code: 80049217


Any insights into what might be causing this issue?

n8n setup

  • n8n version: 1.1.1
  • Database: Aurora Postgres
  • EXECUTIONS_MODE: “queue”
  • Running n8n via: Docker
  • Operating system: Linux

Hi @christiano :wave:

This might be a little bit of a long shot, but have you tried changing the Authorization and Token URL to contain your tenant ID?

Try using the options below replacing {tenant} with your tenant ID.

Authorization URL: https://login.microsoftonline.com/{tenant}/oauth2/v2.0/authorize
Access Token URL: https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token

image

Let me know if that helps!

1 Like

Hi @EmeraldHerald

My settings already use the url with the tenant ID and unfortunately the same problem occurs.

Any other idea?
Tks

That’s how I set ours up and it worked, I’d check your Azure App Registration API permissions and make sure none are missing

1 Like

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