Skip to content

Comments

Reorganizing OAuth Flow#99

Merged
axelsrz merged 34 commits intomainfrom
users/robrandao/update-authorization
Aug 25, 2025
Merged

Reorganizing OAuth Flow#99
axelsrz merged 34 commits intomainfrom
users/robrandao/update-authorization

Conversation

@rodrigobr-msft
Copy link
Contributor

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 SignInState mechanism with a new FlowState-based system, updating imports and type definitions.

OAuth Flow Refactor and Abstractions

  • Introduced new classes and enums: FlowState, FlowStateTag, FlowErrorTag, and FlowResponse for managing OAuth flows, replacing the previous SignInState-based approach. (libraries/microsoft-agents-hosting-core/microsoft/agents/hosting/core/oauth/flow_state.py, [1] [2] [3]
  • Added FlowStorageClient and refactored OAuth flow handling to use FlowResponse and FlowState objects 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

  • Refactored turn and activity handling in agent_application.py to 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]
  • Removed legacy sign-in state logic and replaced it with flow state checks and response handling. (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

  • Updated and reorganized imports across multiple __init__.py files 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

@rodrigobr-msft rodrigobr-msft requested a review from axelsrz August 22, 2025 21:59
@rodrigobr-msft rodrigobr-msft linked an issue Aug 25, 2025 that may be closed by this pull request
@axelsrz axelsrz linked an issue Aug 25, 2025 that may be closed by this pull request
@axelsrz axelsrz merged commit 5a59087 into main Aug 25, 2025
5 checks passed
@axelsrz axelsrz linked an issue Aug 25, 2025 that may be closed by this pull request
@rodrigobr-msft rodrigobr-msft deleted the users/robrandao/update-authorization branch September 18, 2025 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OAtuh refactor Auth card needs number of retries Authentication Refactor

2 participants