You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/channels/msteams.md
+156-2Lines changed: 156 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ title: "Microsoft Teams"
9
9
10
10
> "Abandon all hope, ye who enter here."
11
11
12
-
Updated: 2026-01-21
12
+
Updated: 2026-03-25
13
13
14
14
Status: text + DM attachments are supported; channel/group file sending requires `sharePointSiteId` + Graph permissions (see [Sending files in group chats](#sending-files-in-group-chats)). Polls are sent via Adaptive Cards. Message actions expose explicit `upload-file` for file-first sends.
4. Expose `/api/messages` (port 3978 by default) via a public URL or tunnel.
44
44
5. Install the Teams app package and start the gateway.
45
45
46
-
Minimal config:
46
+
Minimal config (client secret):
47
47
48
48
```json5
49
49
{
@@ -59,6 +59,8 @@ Minimal config:
59
59
}
60
60
```
61
61
62
+
For production deployments, consider using [federated authentication](#federated-authentication-certificate--managed-identity) (certificate or managed identity) instead of client secrets.
63
+
62
64
Note: group chats are blocked by default (`channels.msteams.groupPolicy: "allowlist"`). To allow group replies, set `channels.msteams.groupAllowFrom` (or use `groupPolicy: "open"` to allow any member, mention-gated).
63
65
64
66
## Goals
@@ -190,6 +192,148 @@ Before configuring OpenClaw, you need to create an Azure Bot resource.
For production deployments, OpenClaw supports **federated authentication** as a more secure alternative to client secrets. Two methods are available:
200
+
201
+
### Option A: Certificate-based authentication
202
+
203
+
Use a PEM certificate registered with your Entra ID app registration.
204
+
205
+
**Setup:**
206
+
207
+
1. Generate or obtain a certificate (PEM format with private key).
208
+
2. In Entra ID → App Registration → **Certificates & secrets** → **Certificates** → Upload the public certificate.
209
+
210
+
**Config:**
211
+
212
+
```json5
213
+
{
214
+
channels: {
215
+
msteams: {
216
+
enabled:true,
217
+
appId:"<APP_ID>",
218
+
tenantId:"<TENANT_ID>",
219
+
authType:"federated",
220
+
certificatePath:"/path/to/cert.pem",
221
+
webhook: { port:3978, path:"/api/messages" },
222
+
},
223
+
},
224
+
}
225
+
```
226
+
227
+
**Env vars:**
228
+
229
+
-`MSTEAMS_AUTH_TYPE=federated`
230
+
-`MSTEAMS_CERTIFICATE_PATH=/path/to/cert.pem`
231
+
232
+
### Option B: Azure Managed Identity
233
+
234
+
Use Azure Managed Identity for passwordless authentication. This is ideal for deployments on Azure infrastructure (AKS, App Service, Azure VMs) where a managed identity is available.
235
+
236
+
**How it works:**
237
+
238
+
1. The bot pod/VM has a managed identity (system-assigned or user-assigned).
239
+
2. A **federated identity credential** links the managed identity to the Entra ID app registration.
240
+
3. At runtime, OpenClaw uses `@azure/identity` to acquire tokens from the Azure IMDS endpoint (`169.254.169.254`).
241
+
4. The token is passed to the Teams SDK for bot authentication.
4. **Label the pod** for workload identity injection:
318
+
319
+
```yaml
320
+
metadata:
321
+
labels:
322
+
azure.workload.identity/use: "true"
323
+
```
324
+
325
+
5. **Ensure network access** to IMDS (`169.254.169.254`) — if using NetworkPolicy, add an egress rule allowing traffic to `169.254.169.254/32` on port 80.
| **Certificate** | `authType: "federated"` + `certificatePath` | No shared secret over network | Certificate management overhead |
333
+
| **Managed Identity** | `authType: "federated"` + `useManagedIdentity` | Passwordless, no secrets to manage | Azure infrastructure required |
334
+
335
+
**Default behavior:** When `authType` is not set, OpenClaw defaults to client secret authentication. Existing configurations continue to work without changes.
336
+
193
337
## Local Development (Tunneling)
194
338
195
339
Teams can't reach `localhost`. Use a tunnel for local development:
@@ -279,6 +423,11 @@ This is often easier than hand-editing JSON manifests.
- `MSTEAMS_MANAGED_IDENTITY_CLIENT_ID`(user-assigned MI only)
282
431
283
432
5. **Bot endpoint**
284
433
- Set the Azure Bot Messaging Endpoint to:
@@ -492,6 +641,11 @@ Key settings (see `/gateway/configuration` for shared channel patterns):
492
641
- `toolsBySender` keys should use explicit prefixes:
493
642
`id:`, `e164:`, `username:`, `name:` (legacy unprefixed keys still map to `id:` only).
494
643
- `channels.msteams.actions.memberInfo`: enable or disable the Graph-backed member info action (default: enabled when Graph credentials are available).
644
+
- `channels.msteams.authType`: authentication type — `"secret"` (default) or `"federated"`.
- `channels.msteams.managedIdentityClientId`: client ID for user-assigned managed identity.
495
649
- `channels.msteams.sharePointSiteId`: SharePoint site ID for file uploads in group chats/channels (see [Sending files in group chats](#sending-files-in-group-chats)).
0 commit comments