# M365 Authentication

**URL:** <https://community.n8n.io/t/m365-authentication/290879>\
**Category:** Questions\
**Created:** [23 أبريل 2026، 10:45م UTC](https://community.n8n.io/t/m365-authentication/290879 "2026-04-23T22:45:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Midnigh7](https://avatars.discourse-cdn.com/v4/letter/m/a3d4f5/32.png) [@Midnigh7](https://community.n8n.io/u/Midnigh7)\
**Post date:** [23 أبريل 2026، 10:45م UTC](https://community.n8n.io/t/m365-authentication/290879/1 "2026-04-23T22:45:45Z")

</div>

I have setup M365 integrations, and they authenticate fine initially. However, it seems that the oauth is not renewing as expected. As a test I have a simple 5m schedule to get a single group from Entra, and it worked for ~1hr. Then it throws;  
“error”: “Authorization failed - please check your credentials”  
However it claims it’s connected.

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/a/8/a87f9b040a9b5d1196c0c1804617fe8b80dca2e8.png)

Clicking ‘Reconnect’ and re authenticating fixes it for a short time.

Anyone else run into this? Any ideas?

---

<div class="post-metadata">

**Author:** ![achamm](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/achamm/32/143734_2.png) [@achamm](https://community.n8n.io/u/achamm)\
**Post date:** [24 أبريل 2026، 12:35ص UTC](https://community.n8n.io/t/m365-authentication/290879/4 "2026-04-24T00:35:57Z")

</div>

@Midnigh7 Benjamin’s right about `offline_access` but honestly the fastest fix is just forcing a token refresh via HTTP Request instead of the built-in node — the native M365 nodes have a known quirk where they don’t always trigger the refresh flow properly.

swap to HTTP Request node with your same Entra creds, the generic OAuth2 path handles refresh tokens way more reliably than the dedicated Entra node does. are you self-hosted or cloud btw?

---

<div class="post-metadata">

**Author:** ![nwnwnw413](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/nwnwnw413/32/169419_2.png) [@nwnwnw413](https://community.n8n.io/u/nwnwnw413)\
**Post date:** [24 أبريل 2026، 2:32ص UTC](https://community.n8n.io/t/m365-authentication/290879/5 "2026-04-24T02:32:33Z")

</div>

achamm’s diagnosis is right — the native M365 nodes handle OAuth refresh inconsistently, especially when the Azure app was registered without `offline_access` from the start. A few things to check in order:

1. Azure Portal → App registrations → API permissions: confirm `offline_access` is in the \*granted\* scopes, not just requested. If it was added after the n8n credential was created, delete the credential and reconnect fresh — n8n caches the original scope set.

2. 1-hour expiry is exactly the access\_token lifetime. If refresh works, n8n should get a new token silently. Check n8n logs around the 1-hour mark for “failed to refresh token” — tells you whether it’s refresh failure vs token not persisting.

3. Benjamin’s suggestion to use generic OAuth2 + HTTP Request also gives you the bonus of one credential shared across Outlook, Graph, SharePoint instead of three separate node-specific credentials.

If you end up with many M365 workflows, pulling the OAuth dance out of n8n entirely and into a gateway (n8n just does `Authorization: Bearer` against a local endpoint) has been worth it. We open-sourced ours — [github.com/ChronoAIProject/NyxID](http://github.com/ChronoAIProject/NyxID) .

---

<div class="post-metadata">

**Author:** ![Midnigh7](https://avatars.discourse-cdn.com/v4/letter/m/a3d4f5/32.png) [@Midnigh7](https://community.n8n.io/u/Midnigh7)\
**Post date:** [24 أبريل 2026، 1:16م UTC](https://community.n8n.io/t/m365-authentication/290879/6 "2026-04-24T13:16:28Z")

</div>

I am using the latest build, self hosted.  
Thanks for the suggestions. I’ll start using the native web requests I guess.

I created a keep-alive flow that runs every 5 minutes with the http request node. That refreshes the creds and the native nodes now work.

---

<div class="post-metadata">

**Author:** ![tamy.santos](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/tamy.santos/32/153776_2.png) [@tamy.santos](https://community.n8n.io/u/tamy.santos)\
**Post date:** [24 أبريل 2026، 2:24م UTC](https://community.n8n.io/t/m365-authentication/290879/7 "2026-04-24T14:24:52Z")

</div>

cheers 🎉 !

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [23 يوليو 2026، 2:25م UTC](https://community.n8n.io/t/m365-authentication/290879/8 "2026-07-23T14:25:46Z")

</div>

تم إغلاقه في في 23 يوليو 2026، 2:25م UTC

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