Merged
Conversation
MattB-msft
approved these changes
Aug 4, 2025
rodrigobr-msft
pushed a commit
that referenced
this pull request
Aug 4, 2025
* Teams sample updates * Teams sample updates * Teams sample updates
kylerohnmsft
pushed a commit
to claire-cho-msft/Agents-for-claire
that referenced
this pull request
Aug 6, 2025
* Teams sample updates * Teams sample updates * Teams sample updates
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.
This pull request introduces significant updates to authentication and configuration handling across multiple files in the Teams Agent sample application. The changes improve token acquisition error handling, streamline environment variable usage, and enhance the structure of authentication and authorization components.
Authentication Enhancements:
libraries/microsoft-agents-authentication-msal/microsoft/agents/authentication/msal/msal_auth.py: Improved error handling inacquire_token_on_behalf_ofby logging and raising exceptions when token acquisition fails.test_samples/app_style/authorization_agent.py: Replaced theget_tokenmethod withexchange_tokento enable token exchange with specific scopes and an authentication handler ID.Configuration Updates:
test_samples/teams_agent/config.py: Updated theDefaultConfigclass to useAgentAuthConfigurationinstead ofMsalAuthConfigurationand revised environment variable keys for better alignment with the SDK structure.test_samples/teams_agent/env.TEMPLATE: Refactored environment variable names to match the updated configuration structure and added placeholders for tenant ID, client ID, client secret, and connection name.Codebase Simplification:
test_samples/teams_agent/app.py: Refactored imports, removed redundantDefaultConnectionandRestChannelServiceClientFactory, and introducedMsalConnectionManagerandAuthorizationfor cleaner authentication handling. Updatedcreate_agentto passSTORAGEexplicitly toTeamsSso. [1] [2]test_samples/teams_agent/teams_sso.py: Modified theTeamsSsoclass to acceptStorageas a parameter and updatedOAuthFlowinitialization to useStorageinstead ofUserState. [1] [2]