Federated authentication (certificate plus managed identity)
For production, OpenClaw supports federated authentication as an alternative to client secrets, viachannels.msteams.authType: "federated". Two methods:
Option A: Certificate-based authentication
Use a PEM certificate registered with your Entra ID app registration. Setup:- Generate or obtain a certificate (PEM format with private key).
- Entra ID → App Registration → Certificates & secrets → Certificates → upload the public certificate.
MSTEAMS_AUTH_TYPE=federatedMSTEAMS_CERTIFICATE_PATH=/path/to/cert.pem
Option B: Azure Managed Identity
Use Azure Managed Identity for passwordless authentication on Azure infrastructure (AKS, App Service, Azure VMs). How it works:- The bot pod/VM has a managed identity (system- or user-assigned).
- A federated identity credential links the managed identity to the Entra ID app registration.
- At runtime, OpenClaw uses
@azure/identityto acquire tokens from the Azure IMDS endpoint. - The token is passed to the Teams SDK for bot authentication.
- Azure infrastructure with managed identity enabled (AKS workload identity, App Service, VM).
- Federated identity credential created on the Entra ID app registration.
- Network access to IMDS (
169.254.169.254:80) from the pod/VM.
managedIdentityClientId: "<MI_CLIENT_ID>" to the block above.
Env vars:
MSTEAMS_AUTH_TYPE=federatedMSTEAMS_USE_MANAGED_IDENTITY=trueMSTEAMS_MANAGED_IDENTITY_CLIENT_ID=<client-id>(user-assigned only)
AKS Workload Identity setup
For AKS deployments using workload identity:- Enable workload identity on your AKS cluster.
-
Create a federated identity credential on the Entra ID app registration:
-
Annotate the Kubernetes service account with the app client ID:
-
Label the pod for workload identity injection:
-
Allow network access to IMDS (
169.254.169.254): if using NetworkPolicy, add an egress rule for169.254.169.254/32on port 80.
Auth type comparison
certificateThumbprint can be set alongside certificatePath but is not read by the auth path today; it is accepted for forward compatibility only.
Default: when authType is unset, OpenClaw uses client-secret authentication (appPassword). Existing configs keep working unchanged.