Teams error AADSTS50011: Redirect URI mismatch in bot sign-in
Last verified against Microsoft Learn - Status codes from bot conversational APIs
InvalidReplyTo - The reply address is missing, misconfigured, or doesn't match reply addresses configured for the app.What error AADSTS50011 means
A user clicked your bot's sign-in button, landed on the Microsoft sign-in page, and saw an error instead of a login form. AADSTS50011 is "InvalidReplyTo - The reply address is missing, misconfigured, or doesn't match reply addresses configured for the app." Entra compared the redirect URI in the request with the list on the app registration and found no match.
For bots using the Azure Bot Service token service, the redirect URI is not your own website. Microsoft's OAuth URL reference lists the values: the default is https://token.botframework.com/.auth/web/redirect, with regional versions for data residency (for example https://europe.token.botframework.com/.auth/web/redirect) and separate ones for Azure Government and Azure operated by 21Vianet. The redirect has to be registered on the app registration used by your OAuth connection, and the Bot Framework authentication article says to add it under the Web platform.
Because the error appears in the user's browser, your bot logs usually show nothing except a sign-in that never completes.
What it looks like
// The Web redirect URI to register for public-cloud bots without data residency
https://token.botframework.com/.auth/web/redirect
// Europe data residency
https://europe.token.botframework.com/.auth/web/redirectWhy it happens
- The token.botframework.com redirect URL was never added to the app registration behind the OAuth connection.
- It was added under the wrong platform type (for example Single-page application instead of Web).
- The bot uses a regional or government token service but the registration lists the default redirect, or the reverse.
- A typo or trailing slash difference in the registered URI.
How to fix Teams error AADSTS50011
- 1Open the app registration used by the OAuth connection, then Authentication.
- 2Under the Web platform, add the redirect URL that matches your bot's OAuth URL (default https://token.botframework.com/.auth/web/redirect).
- 3If you configured a regional OAuthUrl in the bot, register that region's redirect URL instead or as well.
- 4Use Test Connection on the Azure Bot's OAuth connection settings to confirm sign-in completes.
How to stop it recurring
Treat the OAuth redirect as part of the bot's environment config: when you change the bot's OAuthUrl for data residency, change the registered redirect in the same change. Run Test Connection after every edit to an OAuth connection, and include it in your setup checklist for new tenants so sign-in is proven before rollout.
Official reference: Microsoft Learn - Status codes from bot conversational APIs. See all Teams error codes or the Teams limits and quotas.
Related codes
- AADSTS65001: User or admin consent missingDelegationDoesNotExist - The user or administrator hasn't consented to use the…
- resourcematchfailed: SSO token exchange resource does not match the app ID URIResource match failed
- AADSTS70011: Invalid scopeInvalidScope - The scope requested by the app is invalid.
- 401 Unauthorized (invalid app ID / password): Invalid Microsoft App ID or passwordAADSTS7000215: Invalid client secret provided.
Error AADSTS50011 - quick answers
What does Teams error AADSTS50011 mean?
A user clicked your bot's sign-in button, landed on the Microsoft sign-in page, and saw an error instead of a login form. AADSTS50011 is "InvalidReplyTo - The reply address is missing, misconfigured, or doesn't match reply addresses configured for the app." Entra compared the redirect URI in the request with the list on the app registration and found no match.
How do I fix Teams error AADSTS50011?
1. Open the app registration used by the OAuth connection, then Authentication. 2. Under the Web platform, add the redirect URL that matches your bot's OAuth URL (default https://token.botframework.com/.auth/web/redirect). 3. If you configured a regional OAuthUrl in the bot, register that region's redirect URL instead or as well. 4. Use Test Connection on the Azure Bot's OAuth connection settings to confirm sign-in completes.
Stop debugging Teams by hand
Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.