Skip to content

Add support for Agentic identity tokens#641

Merged
tracyboehrer merged 69 commits intomainfrom
users/benbro/merge-with-cecilia
Oct 16, 2025
Merged

Add support for Agentic identity tokens#641
tracyboehrer merged 69 commits intomainfrom
users/benbro/merge-with-cecilia

Conversation

@benbrown
Copy link
Copy Markdown
Contributor

@benbrown benbrown commented Oct 8, 2025

Part of #604, this change introduces new methods to obtain new types of agentic token.

These are used when an incoming request contains Agentic identity elements in the recipient object. Rather than create an outbound connection with the default agent identity, this will load the appropriate agentic identity and create access tokens for that app and/or user.

This will allow a single agent application to respond appropriately to multiple agentic identities.

Resolves #627 update the model
Resolves #629 add the APX scope constants
Fixes #626 Connections and Connection Map
Fixes #630
Fixes #605
Fixes #648
Fixes #377
Fixes #466
Fixes #516
Fixes #517
Fixes #628

Breaking changes

  • ContinueConversation
    • CloudAdapter.continueConversation adds the botAppIdOrIdentity: string | JwtPayload argument
    • AgentApplication.sendProactiveActivity adds the botAppIdOrIdentity: string | JwtPayload argument
  • CloudAdapter getAttachment/getAttachmentInfo/uploadAttachment add a TurnContext argument
  • CloudAdapter.ConnectorClient and CloudAdapter.UserTokenClient have been removed. Get current of each via TurnContext.turnState
  • AgentApplication.authorization.beginOrContinueFlow removed, AgentApplication.authorization.authHandlers removed.
  • oAuthFlow class removed
  • All Authorization related classes are internal, never exported in the index.ts.

benbrown and others added 30 commits October 3, 2025 10:37
…r-attachments

Adjusted CloudAdapter uploadAttachment/getAttachmentInfo/getAttachment
tracyboehrer and others added 11 commits October 15, 2025 12:30
Co-authored-by: Tracy Boehrer <trboehre@microsoft.com>
…s was not handled properly (#665)

Co-authored-by: tracyboehrer <tracyboehrer@users.noreply.github.com>
Co-authored-by: Tracy Boehrer <trboehre@microsoft.com>
Co-authored-by: Tracy Boehrer <trboehre@microsoft.com>
Co-authored-by: tracyboehrer <tracyboehrer@users.noreply.github.com>
* Fix cloudAdapter linter problems

* update syntax for adapter members

* Do not start cache purge unless values exist

* throw an error if payload of jwt is empty

* remove console.log

---------

Co-authored-by: tracyboehrer <tracyboehrer@users.noreply.github.com>
Co-authored-by: Tracy Boehrer <trboehre@microsoft.com>
* Add OBO connection and scopes

* Fix jsdoc

* Add default sign-in text

* Fix doc
* For agentic access token, use agenticUserId field instead of ID field.

* Change `username` to `user_id` in agenticUserToken request

---------

Co-authored-by: tracyboehrer <tracyboehrer@users.noreply.github.com>
@tracyboehrer tracyboehrer marked this pull request as ready for review October 16, 2025 14:18
Copilot AI review requested due to automatic review settings October 16, 2025 14:18
tracyboehrer
tracyboehrer previously approved these changes Oct 16, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for Agentic identity tokens, enabling agent applications to respond appropriately to multiple agentic identities by creating access tokens for specific app and/or user contexts rather than using the default agent identity.

Key changes include:

  • Introduction of new authorization system with multiple handler types (Azure Bot and Agentic)
  • Addition of agentic token acquisition methods (instance, user, and application tokens)
  • Breaking changes to continueConversation and attachment methods requiring additional parameters
  • Removal of deprecated OAuth flow components and SSO handlers

Reviewed Changes

Copilot reviewed 71 out of 72 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test-agents/web-chat/src/webChatSso.ts Removed entire WebChatSso handler implementation
test-agents/web-chat/src/index.ts Updated continueConversation call and removed webChatSso case
test-agents/root-agent/src/agent.ts Updated postActivity call with placeholder config
test-agents/application-style/src/webChatSso.ts Removed entire application-style WebChatSso handler
samples/teams/teamsInfoExample.ts Updated to extract tenantId from channel data instead of adapter config
samples/basic/routes.ts Added agentic route handler example
samples/basic/proactive.ts Updated continueConversation calls with clientId parameter
packages/agents-hosting/src/cloudAdapter.ts Major refactor with new connection management and agentic token support
Comments suppressed due to low confidence (2)

packages/agents-hosting/src/cloudAdapter.ts:1

  • The magic number 325 should be extracted to a named constant to improve code readability and maintainability. Consider adding a comment explaining why this specific limit exists.
/**

packages/agents-hosting/src/cloudAdapter.ts:1

  • Duplicate code: The conversation ID trimming logic appears multiple times. Consider extracting this into a private method to avoid repetition and ensure consistent behavior.
/**

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread test-agents/root-agent/src/agent.ts
Comment thread samples/basic/routes.ts
Comment thread packages/agents-hosting/src/auth/msalTokenProvider.ts
Comment thread packages/agents-hosting/src/agent-client/agentResponseHandler.ts
Comment thread packages/agents-activity/src/conversation/conversationAccount.ts
Comment thread packages/agents-hosting/src/app/agentApplication.ts
Comment thread packages/agents-hosting/src/app/agentApplication.ts
Comment thread packages/agents-hosting/src/app/agentApplication.ts
Comment thread packages/agents-hosting/src/connector-client/connectorClient.ts
Comment thread packages/agents-hosting/src/cloudAdapter.ts
Copy link
Copy Markdown
Contributor Author

@benbrown benbrown left a comment

Choose a reason for hiding this comment

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

Approved pending a few small tweaks as mentioned

Co-authored-by: tracyboehrer <tracyboehrer@users.noreply.github.com>
@tracyboehrer tracyboehrer merged commit 9f0307d into main Oct 16, 2025
7 checks passed
@tracyboehrer tracyboehrer deleted the users/benbro/merge-with-cecilia branch October 16, 2025 17: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

5 participants