OAuth2 Microsoft - "invalid_client" Error (AADSTS7000222: Expired Secret) Despite Creating New Secret

Describe the problem/error/question

I’m trying to connect a Microsoft account to n8n using OAuth2 (client credentials flow), but I keep receiving an “invalid_client” error indicating that the client secret is expired — even though I’ve already created and applied a new secret in the Azure Portal. I’m not sure if this is a caching issue, a config error in n8n, or something on Azure’s side.

What is the error message (if any)?

{
“error”: “invalid_client”,
“error_description”: “AADSTS7000222: The provided client secret keys for app ‘d732aeb1-ad6b-41fa-8ff1-093b175cb1fa’ are expired. Visit the Azure portal to create new keys for your app: How to register an app in Microsoft Entra ID - Microsoft identity platform | Microsoft Learn, or consider using certificate credentials for added security: Microsoft identity platform certificate credentials - Microsoft identity platform | Microsoft Learn. Trace ID: 29f15238-f610-4143-bbd5-1298cf541002 Correlation ID: c8a1076f-cb99-4720-b1cc-5a3e7db81b64 Timestamp: 2025-06-10T12:52:31Z”
}

Please share your workflow

This is a simple test workflow using the Microsoft Graph API to fetch users using the OAuth2 API credential configured with the client credentials grant type.

  1. HTTP node configured to GET https://graph.microsoft.com/v1.0/users
  2. Uses Microsoft OAuth2 credential with:
    • Auth URL: https://login.microsoftonline.com/common/oauth2/v2.0/authorize
    • Token URL: https://login.microsoftonline.com/common/oauth2/v2.0/token

Share the output returned by the last node

Status Code: 401
{
“error”: “invalid_client”,
“error_description”: “AADSTS7000222: The provided client secret keys for app ‘d732aeb1-ad6b-41fa-8ff1-093b175cb1fa’ are expired.”
}

Information on your n8n setup

  • n8n version: 1.95.3
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu

Additional info:

  • I deleted and re-added the OAuth2 credentials in n8n.
  • I created a brand-new client secret in Azure and copied it immediately after creation.
  • I restarted the n8n instance to avoid any caching issues.
  • The secret is confirmed to be valid and active in Azure.

Questions:

  • Can you please help me in solving this issuer?

Thanks in advance for any help!

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