Add support for bearer token - semantic kernel sample#125
Merged
Conversation
Contributor
There was a problem hiding this comment.
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_TOKENenvironment 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 |
pontemonti
reviewed
Dec 11, 2025
pontemonti
reviewed
Dec 11, 2025
pontemonti
reviewed
Dec 16, 2025
sellakumaran
previously approved these changes
Dec 18, 2025
skg-marimuthu
previously approved these changes
Dec 18, 2025
tmlsousa
reviewed
Dec 18, 2025
tmlsousa
reviewed
Dec 18, 2025
008ec04
skg-marimuthu
previously approved these changes
Dec 18, 2025
pontemonti
reviewed
Dec 18, 2025
pontemonti
approved these changes
Dec 18, 2025
sellakumaran
approved these changes
Dec 18, 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.
No description provided.