microsoft / botframework-sdk

Bot Framework provides the most comprehensive experience for building conversation applications.
MIT License
7.49k stars 2.44k forks source link

Neither `tid` nor `tenantId` claim is present in the token #6644

Closed pm7y closed 2 weeks ago

pm7y commented 5 months ago

Version

4.22.2

Describe the bug

Whenever the C# bot app service receives a message (via /api/messages), the following exception is logged in app insights: IDX40003: Neither tid nor tenantId claim is present in the token obtained from Microsoft identity platform.

To Reproduce

We have a multitenant Azure bot with a teams channel. When a message is sent to the bot C# app service via the Teams channel the bot successfully receives and processes the message and replies to the sender as expected. However, there is an error message (above) logged in app insights, indicating there is a problem.

Expected behavior

The tenant id shouldn't matter for a multitenant bot, right? How can I resolve this exception?

Screenshots

image

Tracking Status

Dotnet SDK [TODO]()

Javascript SDK [TODO]()

Python SDK [TODO]()

Java SDK [TODO]()

Samples [TODO]()

Docs [TODO]()

Tools [TODO]()

tracyboehrer commented 2 months ago

The token from Azure Bot Service does not contain either of these claims. It never has. But more recently this gets flagged. There is nothing the bot side can do about this though. I am curious about where this is happening from though. Is this from App Insights on the bot itself? Because the SDK perform token validation on its own, and doesn't rely on AspNet.Core validation.

dmvtech commented 2 weeks ago

Closing due to lack of response. If assistance is still needed, please comment with pertinent information and we will continue.

tracyboehrer commented 2 weeks ago

As a final comment... this will likely change in the not too distant future.