Skip to content

Pass authHandlerName to Authorization.exchangeToken - #67

Merged
pontemonti merged 4 commits into
mainfrom
users/johanb/AuthHandler
Nov 17, 2025
Merged

Pass authHandlerName to Authorization.exchangeToken#67
pontemonti merged 4 commits into
mainfrom
users/johanb/AuthHandler

Conversation

@pontemonti

Copy link
Copy Markdown
Contributor

No description provided.

@pontemonti
pontemonti marked this pull request as ready for review November 17, 2025 17:13
Copilot AI review requested due to automatic review settings November 17, 2025 17:13
@pontemonti
pontemonti requested a review from a team as a code owner November 17, 2025 17:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the authentication flow to pass authHandlerName to the Authorization.exchangeToken method instead of hardcoding it as 'agentic', and introduces dynamic agent identity resolution from tokens rather than requiring an explicit agentUserId parameter.

Key Changes:

  • Added authHandlerName parameter to the token exchange flow, making authentication handler configurable
  • Introduced a new Utility class in agents-a365-runtime to resolve agent identity dynamically from JWT tokens or turn context
  • Removed the agentUserId parameter from MCP tool registration methods, replacing it with runtime identity resolution

Reviewed Changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/agents-a365-runtime/src/utility.ts New utility class for decoding JWT tokens and resolving agent identity
packages/agents-a365-runtime/src/index.ts Exports the new Utility class
packages/agents-a365-runtime/src/agentic-authorization-service.ts Updated to accept authHandlerName parameter instead of hardcoding 'agentic'
packages/agents-a365-tooling-extensions-openai/src/McpToolRegistrationService.ts Removed agentUserId parameter, added authHandlerName, uses dynamic identity resolution
packages/agents-a365-tooling-extensions-langchain/src/McpToolRegistrationService.ts Same parameter updates as OpenAI extension
packages/agents-a365-tooling-extensions-claude/src/McpToolRegistrationService.ts Same parameter updates as OpenAI extension
packages/agents-a365-tooling/src/McpToolServerConfigurationService.ts Renamed parameter from agentUserId to agenticAppId for clarity
packages/agents-a365-tooling/src/Utility.ts Updated documentation to reflect new terminology (agent identity vs digital worker)
tests-agent/openai-agent-auto-instrument-sample/src/OpenAIClient.ts Updated to pass authHandlerName parameter
tests-agent/openai-agent-auto-instrument-sample/src/A365Agent.ts Defines authHandlerName as 'agentic' and passes it to getClient
packages/agents-a365-runtime/package.json Added jsonwebtoken dependency
pnpm-workspace.yaml Added jsonwebtoken version override
pnpm-lock.yaml Updated with jsonwebtoken and its types
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)

packages/agents-a365-tooling/src/Utility.ts:1

  • The example URL uses a placeholder {agenticAppId} in curly braces, but the actual implementation on line 81 uses string interpolation that would produce a literal value, not a placeholder. Update the example to show a concrete app ID value (e.g., 'agent-123') to match the pattern from line 73.
// Copyright (c) Microsoft Corporation.

Comment thread packages/agents-a365-runtime/src/utility.ts
Comment thread packages/agents-a365-runtime/src/utility.ts
@pontemonti
pontemonti merged commit c27346a into main Nov 17, 2025
13 checks passed
@pontemonti
pontemonti deleted the users/johanb/AuthHandler branch November 17, 2025 17:19
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.

3 participants