From 653dfc6cf7a0d07855aeed8a70464e8fe8242e41 Mon Sep 17 00:00:00 2001 From: Ilfat Mindubaev Date: Thu, 13 Aug 2026 08:38:45 +0000 Subject: [PATCH] fix(Microsoft Teams Node): Restore Group.ReadWrite.All OAuth2 scope (#36005) Co-authored-by: Claude Fable 5 --- .../credentials/MicrosoftTeamsOAuth2Api.credentials.ts | 4 +++- .../test/MicrosoftTeamsOAuth2Api.credentials.test.ts | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/nodes-base/credentials/MicrosoftTeamsOAuth2Api.credentials.ts b/packages/nodes-base/credentials/MicrosoftTeamsOAuth2Api.credentials.ts index 6b19d9249c2..45efebccbf8 100644 --- a/packages/nodes-base/credentials/MicrosoftTeamsOAuth2Api.credentials.ts +++ b/packages/nodes-base/credentials/MicrosoftTeamsOAuth2Api.credentials.ts @@ -1,10 +1,12 @@ import type { ICredentialType, INodeProperties } from 'n8n-workflow'; +// Group.ReadWrite.All covers channel create/update/delete, channel-message send and +// Planner task writes — downgrading it to Group.Read.All breaks those operations (#35992). const defaultScopes = [ 'openid', 'offline_access', 'User.Read.All', - 'Group.Read.All', + 'Group.ReadWrite.All', 'Chat.ReadWrite', 'ChannelMessage.Read.All', ]; diff --git a/packages/nodes-base/credentials/test/MicrosoftTeamsOAuth2Api.credentials.test.ts b/packages/nodes-base/credentials/test/MicrosoftTeamsOAuth2Api.credentials.test.ts index 9a10f0f691b..f1c58143308 100644 --- a/packages/nodes-base/credentials/test/MicrosoftTeamsOAuth2Api.credentials.test.ts +++ b/packages/nodes-base/credentials/test/MicrosoftTeamsOAuth2Api.credentials.test.ts @@ -9,7 +9,7 @@ describe('MicrosoftTeamsOAuth2Api Credential', () => { 'openid', 'offline_access', 'User.Read.All', - 'Group.Read.All', + 'Group.ReadWrite.All', 'Chat.ReadWrite', 'ChannelMessage.Read.All', ]; @@ -70,7 +70,7 @@ describe('MicrosoftTeamsOAuth2Api Credential', () => { (p) => p.name === 'enabledScopes', ); expect(enabledScopesProperty?.default).toBe( - 'openid offline_access User.Read.All Group.Read.All Chat.ReadWrite ChannelMessage.Read.All', + 'openid offline_access User.Read.All Group.ReadWrite.All Chat.ReadWrite ChannelMessage.Read.All', ); }); @@ -84,7 +84,7 @@ describe('MicrosoftTeamsOAuth2Api Credential', () => { expect(authUri).toContain('openid'); expect(authUri).toContain('offline_access'); expect(authUri).toContain('User.Read.All'); - expect(authUri).toContain('Group.Read.All'); + expect(authUri).toContain('Group.ReadWrite.All'); expect(authUri).toContain('Chat.ReadWrite'); expect(authUri).toContain('ChannelMessage.Read.All'); expect(authUri).toContain(`client_id=${clientId}`); @@ -101,7 +101,7 @@ describe('MicrosoftTeamsOAuth2Api Credential', () => { expect(token.data.scope).toContain('openid'); expect(token.data.scope).toContain('offline_access'); expect(token.data.scope).toContain('User.Read.All'); - expect(token.data.scope).toContain('Group.Read.All'); + expect(token.data.scope).toContain('Group.ReadWrite.All'); expect(token.data.scope).toContain('Chat.ReadWrite'); expect(token.data.scope).toContain('ChannelMessage.Read.All'); }); @@ -112,7 +112,7 @@ describe('MicrosoftTeamsOAuth2Api Credential', () => { 'openid', 'offline_access', 'User.Read.All', - 'Group.Read.All', + 'Group.ReadWrite.All', 'Chat.ReadWrite', 'ChannelMessage.Read.All', 'Chat.Read.All',