Azure app client connection breaks when reconnecting

Describe the problem/error/question

After registering the app in Azure, and configuring all permissions & callback URI, I initially get a “connection succesful” and the nodes work, However after some time / or when i manually click reconnect account in the credential pane I get:

{"error":"invalid_client","error_description":"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app 

This has been consistent behaviour after many experiments where I inidivdually change app permissions, autentication methods, authorization urls and access token URLS. It only works again when a new secret is created. Experation time is always set 180 Days.

What is the error message (if any)?

{"error":"invalid_client","error_description":"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app 

Please share your workflow

Share the output returned by the last node

{“error”:“invalid_client”,“error_description”:"AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app

Information on your n8n setup

  • n8n version: 2.4.3
  • Database (default: SQLite): postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker
  • Operating system: Linux ubuntu on vm
  • platform: docker (self-hosted)
  • nodeJsVersion: 22.21.1
  • nodeEnv: production
  • database: postgres
  • executionMode: regular
  • concurrency: -1
  • license: community
  • consumerId: unknown

Hi @bonox !

This happens when Azure receives a refresh-token request with an invalid client secret.

Make sure you are using the Client Secret VALUE (not the ID), and whenever you rotate the secret in Azure, create a new credential in n8n and reauthorize, the “Reconnect account” button will not update the stored secret.

This behavior is expected with Azure AD OAuth and explains why it works initially but fails later on reconnect.