fix(Microsoft Teams Node): Restore Group.ReadWrite.All OAuth2 scope (#36005)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Ilfat Mindubaev
2026-08-13 08:38:45 +00:00
committed by GitHub
parent 90a6033f61
commit 653dfc6cf7
2 changed files with 8 additions and 6 deletions
@@ -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',
];
@@ -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',