Skip to content

End-to-end fixes for agentic identities#145

Merged
rodrigobr-msft merged 11 commits intomainfrom
users/robrandao/agentic-test-code
Oct 6, 2025
Merged

End-to-end fixes for agentic identities#145
rodrigobr-msft merged 11 commits intomainfrom
users/robrandao/agentic-test-code

Conversation

@rodrigobr-msft
Copy link
Contributor

@rodrigobr-msft rodrigobr-msft commented Oct 2, 2025

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 UserTokenClient and ConnectorClient instances are created, ensuring that the TurnContext is 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

  • Refactored the creation of UserTokenClient and ConnectorClient instances in channel_service_adapter.py to require the TurnContext and store the token client in context.turn_state, improving context-aware authentication and ensuring proper token handling for agentic and user flows. [1] [2] [3] [4]
  • Updated the abstract methods in channel_service_client_factory_base.py to require the TurnContext parameter for both create_connector_client and create_user_token_client, enforcing context-aware client creation throughout the codebase. [1] [2]
  • Refactored rest_channel_service_client_factory.py to split agentic token retrieval into a dedicated _get_agentic_token method, improve error handling, and require both context and claims_identity for client creation. Enhanced validation and logging for agentic and user token acquisition. [1] [2] [3] [4] [5]

Conversation ID Length Enforcement

  • Added logic to all relevant methods in connector_client.py to truncate conversation_id to 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

  • Added a template environment file and requirements for agentic test samples, enabling easier configuration and setup for agentic authorization and connection mapping. [1] [2]

@rodrigobr-msft rodrigobr-msft changed the title Agentic Quickstart Sample Agentic end-to-end support Oct 6, 2025
@rodrigobr-msft rodrigobr-msft changed the title Agentic end-to-end support End-to-end fixes for agentic identities Oct 6, 2025
@cleemullins cleemullins marked this pull request as ready for review October 6, 2025 18:18
Copy link
Collaborator

@cleemullins cleemullins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@rodrigobr-msft rodrigobr-msft merged commit eb8f016 into main Oct 6, 2025
8 checks passed
@rodrigobr-msft rodrigobr-msft deleted the users/robrandao/agentic-test-code branch October 6, 2025 23:27
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.

Create Sample describing use of Agentic Identity for Python Samples

2 participants

Comments