diff --git a/packages/nodes-base/credentials/DatabricksOAuth2Api.credentials.ts b/packages/nodes-base/credentials/DatabricksOAuth2Api.credentials.ts index 2955fd01db4..9ace7e60a3d 100644 --- a/packages/nodes-base/credentials/DatabricksOAuth2Api.credentials.ts +++ b/packages/nodes-base/credentials/DatabricksOAuth2Api.credentials.ts @@ -55,14 +55,14 @@ export class DatabricksOAuth2Api implements ICredentialType { { // Re-declared because the base `oAuth2Api` field is `doNotInherit`, so it // never reaches the decrypted credential. Without it the value is always - // undefined and token refresh is hardcoded to 401 — workspaces fronted by - // a proxy that rewrites 401 to 403 can set 403 here to keep refreshing. + // undefined and token refresh is hardcoded to 401 — Databricks returns 403 + // when tokens expire, so the default must be 403. displayName: 'Token Expired Status Code', name: 'tokenExpiredStatusCode', type: 'number', - default: 401, + default: 403, description: - 'HTTP status code that indicates the token has expired. Some APIs return 403 instead of 401.', + 'HTTP status code that indicates the token has expired. Databricks returns 403 when tokens expire.', }, ]; diff --git a/packages/nodes-base/credentials/test/DatabricksOAuth2Api.credentials.test.ts b/packages/nodes-base/credentials/test/DatabricksOAuth2Api.credentials.test.ts index 15628f24926..1228b9f4c11 100644 --- a/packages/nodes-base/credentials/test/DatabricksOAuth2Api.credentials.test.ts +++ b/packages/nodes-base/credentials/test/DatabricksOAuth2Api.credentials.test.ts @@ -24,8 +24,8 @@ describe('DatabricksOAuth2Api Credential', () => { expect(field).toBeDefined(); }); - it('should default to 401 to preserve existing behavior', () => { - expect(field?.default).toBe(401); + it('should default to 403 since Databricks returns 403 for expired tokens', () => { + expect(field?.default).toBe(403); }); it('should be a configurable number field (not hidden)', () => {