DRAFT - feat: add multi-connection OAuth registry and flow APIs - #561
Draft
Lily Du (lilyydu) wants to merge 1 commit into
Draft
DRAFT - feat: add multi-connection OAuth registry and flow APIs#561Lily Du (lilyydu) wants to merge 1 commit into
Lily Du (lilyydu) wants to merge 1 commit into
Conversation
Lily Du (lilyydu)
force-pushed
the
lilyydu/03-oauth-registry
branch
from
August 13, 2026 21:07
d6c9e38 to
7f73326
Compare
Lily Du (lilyydu)
force-pushed
the
lilyydu/03-oauth-registry
branch
from
August 13, 2026 21:23
7f73326 to
3cb3dac
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds the public OAuth flow/registry surface that lets apps register and
use multiple named OAuth connections instead of relying only on the app-level
default connection.
The shape mirrors the C# SDK’s
OAuthFlow/AddOAuthFlow(...)model whileremaining additive for existing teams.py apps.
What changed
OAuth flow registry
OAuthFlow, representing one named OAuth connection.OAuthFlowRegistry, a case-insensitive, insertion-ordered registry.App.add_oauth_flow(...)to register a connection and return its flow.App.get_oauth_flow(...)to retrieve a registered flow by connection name.ValueErrorcase-insensitively.Flow operations
Each
OAuthFlowcan now operate against its own connection:OAuthFlow.sign_in(...)always forces the flow’s connection name, so callers cannot accidentally pass options for one connection through another flow.ActivityContext OAuth helpers
ctx.sign_out(connection_name=...)can now sign out a specific connection.ctx.get_user_token(connection_name=...)reads a token for a specific connection.Nonefor Token Service 404 / not signed in.ctx.get_token_status()retrieves status for all registered bot OAuth connections.Events
SignInFailureEvent.-> the existing
ErrorEventfor backward compatibility;-> the new
sign_in_failureevent with connection name/code/message details.Public exports
OAuthFlowandOAuthFlowRegistryfrommicrosoft_teams.apps.