Merged
Conversation
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 several changes to improve the handling of anonymous authentication and environment configuration in the Microsoft Agents Builder and related test samples. The most important changes include adding support for an anonymous token provider, updating the configuration to use environment variables, and refining the anonymous authentication strategy.
Improvements to Anonymous Authentication:
libraries/Builder/microsoft-agents-builder/microsoft/agents/builder/channel_service_adapter.py: Changed the condition to use anonymous authentication if theclaims_identity.authentication_typeis "Anonymous".libraries/Builder/microsoft-agents-builder/microsoft/agents/builder/rest_channel_service_client_factory.py: Introduced_ANONYMOUS_TOKEN_PROVIDERand updated thecreate_connector_clientandcreate_user_token_clientmethods to use the anonymous token provider whenuse_anonymousisTrue. [1] [2] [3]libraries/Core/microsoft-agents-authorization/microsoft/agents/authorization/anonymous_token_provider.py: Added a newAnonymousTokenProviderclass that provides an anonymous token for authentication.libraries/Core/microsoft-agents-authorization/microsoft/agents/authorization/jwt_token_validator.py: Added aget_anonymous_claimsmethod to return aClaimsIdentitywith anonymous authentication.libraries/Hosting/microsoft-agents-hosting-aiohttp/microsoft/agents/hosting/aiohttp/jwt_authorization_middleware.py: Refined the anonymous strategy by settingrequest["claims_identity"]to the result ofget_anonymous_claimswhenCLIENT_IDis not provided.Environment Configuration Updates:
test_samples/agent_to_agent/agent_1/app.py,test_samples/agent_to_agent/agent_2/app.py,test_samples/echo_agent/app.py: Addedload_dotenv()to load environment variables from a.envfile. [1] [2] [3]test_samples/agent_to_agent/agent_1/config.py,test_samples/agent_to_agent/agent_2/config.py,test_samples/echo_agent/config.py: Updated the configuration classes to use environment variables forTENANT_ID,CLIENT_ID,CLIENT_SECRET, and other settings. [1] [2] [3]