I created a app registration with my microsoft 365 licenced user and granted the necessary permissions with the tenant admin user. In n8n I'm using "microsoft teams create message in channel" node to create a message in a specific channel but I get the error: 403 "errorMessage": "Failed to get license information for the user. Ensure user has a valid Office365 license assigned to.
Note that:
- The user does have a microsoft 365 licence
- I did create an app secret and provided to the n8n authentication credential
- The n8n connection to the microsof account succeeds
- If I query https://graph.microsoft.com/v1.0/me/licenseDetails in the microsoft graph explorer, if returns a 200 OK code with the licence details
- The app created in azure portal does have the necessary permissions
Here's the full error log:
{
"errorMessage": "Failed to get license information for the user. Ensure user has a valid Office365 license assigned to them.",
"errorDetails": {
"rawErrorMessage": [
"Failed to get license information for the user. Ensure user has a valid Office365 license assigned to them."
],
"httpCode": "403"
},
"n8nDetails": {
"nodeName": "Microsoft Teams1",
"nodeType": "n8n-nodes-base.microsoftTeams",
"nodeVersion": 2,
"resource": "channelMessage",
"operation": "create",
"time": "25/02/2025, 09:22:29",
"n8nVersion": "1.79.3 (Self Hosted)",
"binaryDataMode": "default",
"stackTrace": [
"NodeApiError: Failed to get license information for the user. Ensure user has a valid Office365 license assigned to them.",
" at ExecuteContext.microsoftApiRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Microsoft/Teams/v2/transport/index.js:37:15)",
" at processTicksAndRejections (node:internal/process/task_queues:95:5)",
" at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Microsoft/Teams/v2/actions/channelMessage/create.operation.js:89:16)",
" at ExecuteContext.router (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Microsoft/Teams/v2/actions/router.js:69:36)",
" at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Microsoft/Teams/v2/MicrosoftTeamsV2.node.js:19:16)",
" at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:627:19)",
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:878:51",
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:1211:20"
]
}
}