Microsoft Teams Bot Framework · error code

Teams error AADSTS70011: Invalid scope

ConfigurationAuthentication & identity

Last verified against Microsoft Learn - Status codes from bot conversational APIs

What Teams returns
InvalidScope - The scope requested by the app is invalid.

What error AADSTS70011 means

Microsoft Entra rejected the scope parameter in your token request. The reference entry is short: "InvalidScope - The scope requested by the app is invalid." The credentials may be perfect; the request asked for something Entra won't issue.

For the bot-to-connector token, Microsoft's Bot Framework authentication guide shows the exact request: a client-credentials call with scope=https%3A%2F%2Fapi.botframework.com%2F.default, which decodes to https://api.botframework.com/.default. Client-credentials requests to the v2.0 endpoint ask for an application's permissions as a whole with the /.default suffix, so values like https://api.botframework.com without the suffix, a space-separated list of delegated scopes, or a mistyped host fail here. The SDKs build this request for you, which is why this error tends to appear in hand-rolled token code, custom HTTP clients, or proxies that rewrite the body.

The same code also shows up in user sign-in flows when an OAuth connection lists scopes the identity provider doesn't recognize, so check which request produced it before changing anything.

What it looks like

// Bot Framework authentication guide - known-good request
curl -X POST https://login.microsoftonline.com/botframework.com/oauth2/v2.0/token \
  -d "grant_type=client_credentials&client_id=APP_ID&client_secret=APP_PASSWORD&scope=https%3A%2F%2Fapi.botframework.com%2F.default"

// Same request with scope=https://api.botframework.com (no /.default)
{
  "error_codes": [70011]
}

Why it happens

  • Custom token code sends the resource URL without the /.default suffix.
  • The scope value was double-encoded or not encoded at all in a form body.
  • Delegated scopes (such as User.Read) were requested in a client-credentials call.
  • An OAuth connection's Scopes field contains a typo or a scope the provider doesn't expose.

How to fix Teams error AADSTS70011

  1. 1Log the outgoing token request body (redact the secret) and read the scope value.
  2. 2For connector tokens, send exactly https://api.botframework.com/.default, URL-encoded in the form body.
  3. 3Prefer the SDK's credential classes over hand-written token requests.
  4. 4For OAuth connections, correct the Scopes field in the Azure Bot's connection settings and run Test Connection.

How to stop it recurring

Keep token acquisition inside the SDK where possible, and if you must call Entra yourself, put the scope in a single constant covered by a test that requests a real token. Review any proxy or API gateway that touches outbound token traffic, since body rewriting is an easy way to corrupt an encoded scope.

Official reference: Microsoft Learn - Status codes from bot conversational APIs. See all Teams error codes or the Teams limits and quotas.

Related codes

Error AADSTS70011 - quick answers

What does Teams error AADSTS70011 mean?

Microsoft Entra rejected the scope parameter in your token request. The reference entry is short: "InvalidScope - The scope requested by the app is invalid." The credentials may be perfect; the request asked for something Entra won't issue.

How do I fix Teams error AADSTS70011?

1. Log the outgoing token request body (redact the secret) and read the scope value. 2. For connector tokens, send exactly https://api.botframework.com/.default, URL-encoded in the form body. 3. Prefer the SDK's credential classes over hand-written token requests. 4. For OAuth connections, correct the Scopes field in the Azure Bot's connection settings and run Test Connection.

Stop debugging Teams by hand

Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.