Changing usage of recipient.id to recipient.agentic_user_id for agentic auth flows#173
Changing usage of recipient.id to recipient.agentic_user_id for agentic auth flows#173
Conversation
…into users/robrandao/agentic-user-id
There was a problem hiding this comment.
Pull Request Overview
This pull request standardizes the identification of agentic users by consistently using agentic_user_id instead of id or upn throughout the codebase. This change improves clarity and eliminates ambiguity in agentic authentication and authorization flows.
- Updated parameter names, documentation, and log messages to use
agentic_user_id - Modified MSAL authentication to use
user_idfield instead ofusernamein token acquisition - Refactored all test cases to reflect the new field usage
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| microsoft_agents/activity/activity.py | Updated get_agentic_user() to return recipient.agentic_user_id instead of recipient.id |
| microsoft_agents/authentication/msal/msal_auth.py | Changed parameter from upn to agentic_user_id and updated token acquisition to use user_id field |
| microsoft_agents/hosting/core/app/oauth/_handlers/agentic_user_authorization.py | Renamed variable from upn to agentic_user_id and updated error messages |
| microsoft_agents/hosting/core/authorization/access_token_provider_base.py | Changed method signature parameter from upn to agentic_user_id |
| microsoft_agents/hosting/core/authorization/anonymous_token_provider.py | Updated method signature to use agentic_user_id parameter |
| microsoft_agents/hosting/core/connector/client/connector_client.py | Increased max conversation ID length and added debugging code with hardcoded test entities |
| tests/activity/test_activity.py | Updated test cases to use agentic_user_id field in ChannelAccount |
| tests/hosting_core/app/_oauth/_handlers/test_agentic_user_authorization.py | Updated test cases to use agentic_user_id field in ChannelAccount |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...osoft-agents-hosting-core/microsoft_agents/hosting/core/connector/client/connector_client.py
Outdated
Show resolved
Hide resolved
...osoft-agents-hosting-core/microsoft_agents/hosting/core/connector/client/connector_client.py
Outdated
Show resolved
Hide resolved
...osoft-agents-hosting-core/microsoft_agents/hosting/core/connector/client/connector_client.py
Outdated
Show resolved
Hide resolved
...aries/microsoft-agents-authentication-msal/microsoft_agents/authentication/msal/msal_auth.py
Outdated
Show resolved
Hide resolved
...osoft-agents-hosting-core/microsoft_agents/hosting/core/connector/client/connector_client.py
Outdated
Show resolved
Hide resolved
...osoft-agents-hosting-core/microsoft_agents/hosting/core/connector/client/connector_client.py
Outdated
Show resolved
Hide resolved
...osoft-agents-hosting-core/microsoft_agents/hosting/core/connector/client/connector_client.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...aries/microsoft-agents-authentication-msal/microsoft_agents/authentication/msal/msal_auth.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…into users/robrandao/agentic-user-id
…microsoft/Agents-for-python into users/robrandao/agentic-user-id
This pull request updates the codebase to consistently use the field
agentic_user_idinstead ofidorupnfor identifying agentic users. The changes impact authentication, authorization, and activity handling logic, as well as related tests. This standardization improves clarity and reduces confusion around user identity fields in agentic scenarios.Core logic and API changes:
agentic_user_idinstead ofidorupnfor agentic user identification, including parameter names, documentation, and log messages. (microsoft_agents/activity/activity.py[1]microsoft_agents/authentication/msal/msal_auth.py[2] [3]microsoft_agents/hosting/core/app/oauth/_handlers/agentic_user_authorization.py[4]microsoft_agents/hosting/core/authorization/access_token_provider_base.py[5]microsoft_agents/hosting/core/authorization/anonymous_token_provider.py[6]Testing updates:
agentic_user_idfield inChannelAccountand related objects, ensuring tests reflect the new field usage. (tests/activity/test_activity.py[1] [2] [3] [4];tests/hosting_core/app/_oauth/_handlers/test_agentic_user_authorization.py[5] [6] [7] [8] [9] [10] [11] [12]