Merged
Conversation
Closed
axelsrz
approved these changes
Aug 25, 2025
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.
This pull request refactors the OAuth flow handling and related authentication logic in the Microsoft Agents Hosting Core library. The changes modernize the flow management, introduce new abstractions, and improve code clarity and maintainability. The most significant updates include replacing the legacy
SignInStatemechanism with a newFlowState-based system, updating imports and type definitions.OAuth Flow Refactor and Abstractions
FlowState,FlowStateTag,FlowErrorTag, andFlowResponsefor managing OAuth flows, replacing the previousSignInState-based approach. (libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/oauth/flow_state.py, [1] [2] [3]FlowStorageClientand refactored OAuth flow handling to useFlowResponseandFlowStateobjects for more robust state management. (libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/oauth/__init__.py, libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/oauth/init.pyR1-R16)Agent Application Logic Refactor
agent_application.pyto use the new flow state and response logic, including new helper methods for handling flow responses and intercepting authentication turns. (libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/agent_application.py, [1] [2] [3]libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/agent_application.py, libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/app/agent_application.pyL610-R703)Codebase and Import Cleanup
__init__.pyfiles to reflect the new abstractions and remove unused or obsolete references. (libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/__init__.py, [1] [2] [3] [4] [5] [6] [7] [8] [9]Minor Improvements
__bool__method toTokenResponsefor clearer truthiness checks. (libraries/microsoft-agents-activity/microsoft/agents/activity/token_response.py, libraries/microsoft-agents-activity/microsoft/agents/activity/token_response.pyR26-R28)