End-to-end fixes for agentic identities#145
Merged
rodrigobr-msft merged 11 commits intomainfrom Oct 6, 2025
Merged
Conversation
…into users/robrandao/agentic-test-code
… depend on it to form the API endpoint
cleemullins
requested changes
Oct 6, 2025
Collaborator
cleemullins
left a comment
There was a problem hiding this comment.
Looks great. Minor comments. I would change the truncation of the conversationId to a single method (normalizeConversationId) and allow it to be changed/overriden without needing a major change in the code.
...aries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/channel_service_adapter.py
Show resolved
Hide resolved
...aries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/channel_service_adapter.py
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
...oft-agents-hosting-core/microsoft_agents/hosting/core/rest_channel_service_client_factory.py
Outdated
Show resolved
Hide resolved
cleemullins
approved these changes
Oct 6, 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 introduces important improvements to the authentication and token handling logic throughout the Microsoft Agents hosting core, as well as enforces stricter conversation ID length constraints in connector client methods. The changes refactor how
UserTokenClientandConnectorClientinstances are created, ensuring that theTurnContextis consistently provided, and enhance error handling and validation for agentic requests. Additionally, new environment and requirements files are added for agentic test samples.Authentication and Token Handling Improvements
UserTokenClientandConnectorClientinstances inchannel_service_adapter.pyto require theTurnContextand store the token client incontext.turn_state, improving context-aware authentication and ensuring proper token handling for agentic and user flows. [1] [2] [3] [4]channel_service_client_factory_base.pyto require theTurnContextparameter for bothcreate_connector_clientandcreate_user_token_client, enforcing context-aware client creation throughout the codebase. [1] [2]rest_channel_service_client_factory.pyto split agentic token retrieval into a dedicated_get_agentic_tokenmethod, improve error handling, and require bothcontextandclaims_identityfor client creation. Enhanced validation and logging for agentic and user token acquisition. [1] [2] [3] [4] [5]Conversation ID Length Enforcement
connector_client.pyto truncateconversation_idto a maximum of 200 characters before using it in API calls, preventing potential errors due to overly long IDs. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]Test Sample Setup