Skip to content

Add support for bearer token - semantic kernel sample#125

Merged
Josina20 merged 20 commits into
mainfrom
users/josjoy/bearertokensupport
Dec 18, 2025
Merged

Add support for bearer token - semantic kernel sample#125
Josina20 merged 20 commits into
mainfrom
users/josjoy/bearertokensupport

Conversation

@Josina20

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings December 10, 2025 22:27
@Josina20 Josina20 requested a review from a team as a code owner December 10, 2025 22:27

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 adds support for bearer token authentication as an alternative to the existing authentication handler in the Semantic Kernel sample agent. The change allows the agent to bypass the standard "MyAuth" sign-in handler when a bearer token is provided via environment variable, enabling scenarios where token-based authentication is preferred over interactive authentication flows.

Key changes:

  • Adds BEARER_TOKEN environment variable configuration for development
  • Conditionally disables auto-signin handlers when bearer token is present
  • Passes bearer token to tool service for authentication when USE_AGENTIC_AUTH is false

Reviewed changes

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

File Description
dotnet/semantic-kernel/sample-agent/Properties/launchSettings.json Adds BEARER_TOKEN environment variable configuration for development launch settings
dotnet/semantic-kernel/sample-agent/Agents/MyAgent.cs Implements conditional logic to skip auto-signin handlers when bearer token is configured, and adds new InstallationUpdate route registration
dotnet/semantic-kernel/sample-agent/Agents/Agent365Agent.cs Adds bearer token retrieval and conditional passing to tool service based on authentication mode

Comment thread dotnet/semantic-kernel/sample-agent/Agents/Agent365Agent.cs Outdated
Comment thread dotnet/semantic-kernel/sample-agent/Properties/launchSettings.json
Comment thread dotnet/semantic-kernel/sample-agent/Agents/Agent365Agent.cs
Comment thread dotnet/semantic-kernel/sample-agent/Agents/MyAgent.cs Outdated
Comment thread dotnet/semantic-kernel/sample-agent/Agents/MyAgent.cs Outdated
Comment thread dotnet/semantic-kernel/sample-agent/Agents/MyAgent.cs Outdated
Comment thread dotnet/semantic-kernel/sample-agent/Agents/Agent365Agent.cs Outdated
Comment thread dotnet/semantic-kernel/sample-agent/Agents/Agent365Agent.cs Outdated
Comment thread dotnet/semantic-kernel/sample-agent/Agents/MyAgent.cs
Comment thread dotnet/semantic-kernel/sample-agent/Agents/Agent365Agent.cs Outdated
Comment thread dotnet/semantic-kernel/sample-agent/Agents/Agent365Agent.cs Outdated
Comment thread dotnet/semantic-kernel/sample-agent/README.md Outdated
Comment thread dotnet/semantic-kernel/sample-agent/README.md Outdated
sellakumaran
sellakumaran previously approved these changes Dec 18, 2025
skg-marimuthu
skg-marimuthu previously approved these changes Dec 18, 2025
Comment thread dotnet/semantic-kernel/sample-agent/Agents/Agent365Agent.cs
Comment thread dotnet/semantic-kernel/sample-agent/README.md Outdated
@Josina20 Josina20 dismissed stale reviews from skg-marimuthu and sellakumaran via 008ec04 December 18, 2025 21:16
skg-marimuthu
skg-marimuthu previously approved these changes Dec 18, 2025
Comment thread dotnet/semantic-kernel/sample-agent/Agents/Agent365Agent.cs Outdated
@Josina20 Josina20 merged commit 45c3826 into main Dec 18, 2025
6 of 7 checks passed
@Josina20 Josina20 deleted the users/josjoy/bearertokensupport branch December 18, 2025 23:52
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.

7 participants