# OAuth2 Credential Disconnecting in n8n

**URL:** <https://community.n8n.io/t/oauth2-credential-disconnecting-in-n8n/259443>\
**Category:** Questions\
**Created:** [February 2, 2026, 1:10pm UTC](https://community.n8n.io/t/oauth2-credential-disconnecting-in-n8n/259443 "2026-02-02T13:10:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marketing\_AIA](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/marketing_aia/32/156504_2.png) [@Marketing\_AIA](https://community.n8n.io/u/Marketing_AIA)\
**Post date:** [February 2, 2026, 1:10pm UTC](https://community.n8n.io/t/oauth2-credential-disconnecting-in-n8n/259443/1 "2026-02-02T13:10:49Z")

</div>

Hi all,

I’m running into an issue with a generic OAuth2 credential in n8n connected to a Microsoft Azure Entra app (not the native Microsoft/Outlook credential).

After connecting, everything works fine initially, but within ~30 minutes the credential becomes completely disconnected and I have to authenticate again. It doesn’t behave like a normal token refresh — the authorization itself appears to be dropped.

What’s confusing is that when our IT admin tested the same OAuth flow locally, access and refresh tokens were handled correctly without any unexpected disconnects. Because of this, it seems like the issue may be specific to how n8n is managing the OAuth session or refresh process.

Has anyone experienced something similar with generic OAuth2 credentials? Any guidance on settings, refresh behavior, token lifetime, or logs to check would be greatly appreciated.

Thanks in advance!

---

<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:** [February 2, 2026, 1:30pm UTC](https://community.n8n.io/t/oauth2-credential-disconnecting-in-n8n/259443/2 "2026-02-02T13:30:38Z")

</div>

Hi @Marketing_AIA

Hope you are doing well

There isn’t a confirmed n8n bug specific to generic OAuth2 with Microsoft Entra. From similar cases, this usually points to token or refresh-token behavior on the provider side rather than n8n itself.

If possible, I’d recommend trying the built-in **Microsoft Entra ID** credential first, since it uses a known and well-tested flow. Also worth checking whether your Entra app is actually issuing a refresh token and whether any Conditional Access policies are forcing re-authentication (which could explain the 30-minute disconnect).

If you can share sanitized details of your OAuth2 credential or confirm whether a refresh token is being stored, that would help narrow it down further.

Reference:

> [@Google Oauth](http://community.n8n.io/t/228459):
>
> I’m using the Google Sheets node in n8n, and my OAuth token keeps expiring. Every time it stops working, I have to manually reconnect my Google account in the n8n credentials panel. The error I get is: “The provided authorization grant or refresh token is invalid, expired, revoked, does not match the redirect URI, or was issued to another client.” It looks like n8n is not receiving or storing a valid refresh token from Google, so the access token can’t auto-refresh. I need help identifying why…

> [@UpWork OAuth2 doesn't refresh tokens](http://community.n8n.io/t/180462):
>
> I have similar issue to [this one](http://community.n8n.io/t/oauth2-upwork-failing-the-next-day/66668) still appearing to me. My graphql node works just fine for exactly 24 hours and then it through Authentication failed error. I manually reconnect the oauth2 credentials and it keeps working for another 24 hours. Is there any fix to that? I don’t want to manually handle refresh tokens in my database.

> **[Microsoft Entra ID credentials | n8n Docs](https://docs.n8n.io/integrations/builtin/credentials/microsoftentra/#microsoft-entra-id-credentials)**
>
> You can use these credentials to authenticate the following nodes: | Documentation for the Microsoft Entra ID credentials. Use these credentials to authenticate Microsoft Entra ID in n8n, a workflow automation platform.

---

<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:** [May 3, 2026, 1:31pm UTC](https://community.n8n.io/t/oauth2-credential-disconnecting-in-n8n/259443/3 "2026-05-03T13:31:06Z")

</div>

Closed on May 3, 2026, 1:31pm UTC

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