Skip to content

SingleTenant bot gets empty 401 from api.botframework.com/api/usertoken/GetToken despite valid bearer token #14263

@Karthik0295

Description

@Karthik0295

Steps to Reproduce

Environment

  • SDK version: botbuilder 4.23.3
  • Node.js: 22.22.0
  • Platform: Microsoft Teams
  • Bot Type: SingleTenant
  • Channel: msteams
  • OS: macOS / Windows Server 2019 (Azure)

Describe the Bug

A SingleTenant Azure Bot registered in Azure returns an empty 401 Unauthorized
from:

  • https://api.botframework.com/api/usertoken/GetToken
  • https://api.botframework.com/api/usertoken/GetTokenStatus

Despite presenting a valid bearer token with correct claims.

The bot successfully acquires its own token from the tenant-specific endpoint,
but api.botframework.com rejects it with an empty 401 and no error message.


Steps to Reproduce

  1. Create an Azure Bot resource with msaAppType: SingleTenant
  2. Register app in Azure AD as AzureADMyOrg
  3. Configure an OAuth connection in the Azure Bot resource
  4. Implement OAuthPrompt in a Teams bot using botbuilder SDK v4.23.3
  5. Set ConfigurationBotFrameworkAuthentication with explicit SingleTenant config

Expected Behavior

/api/usertoken/GetToken should:

  • Return the user token, or
  • Return 404 if no token is cached

A 401 should not occur when the token is valid.


Actual Behavior

Metadata

Metadata

Assignees

Labels

needs-author-feedbackNeeds more info from the customer.teams-developer-supportQuestion related to extensibility (Bot, ME, Tab) would be marked under this label

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions