microsoft/teams.net

Public

mirrored from https://github.com/microsoft/teams.netAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
main

Branches

Tags

  • No tags available.
71Branches16Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

Commit

Add CompatTeamsSSOTokenExchangeMiddleware for SSO token exchange

The BF SDK's TeamsSSOTokenExchangeMiddleware triggers code paths through
TeamsActivityHandler.OnTeamsMembersAddedDispatchAsync that call
TeamsInfo.GetMemberAsync, which casts IConversations to the concrete
Conversations class. This fails with InvalidCastException because
CompatConversations only implements IConversations:

  System.InvalidCastException: Unable to cast object of type
  'Microsoft.Teams.Bot.Compat.CompatConversations' to type
  'Microsoft.Bot.Connector.Conversations'.

This adds CompatTeamsSSOTokenExchangeMiddleware as a drop-in replacement
that works with CompatUserTokenClient. Calling code should use this
middleware and CompatTeamsInfo instead of the BF SDK equivalents.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Changed files1Full changed-file index
Branches0Containing branches
Tags0Containing tags