Adding support for IMDS auth#413
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new AuthTypes.identity_proxy_manager authentication mode and wires it into MsalAuth so agentic application tokens can be acquired via a managed-identity-style client, with configuration support and accompanying tests.
Changes:
- Introduces
identity_proxy_manageras a newAuthTypesenum value. - Extends
AgentAuthConfigurationwith an optionalIDPM_RESOURCEsetting and adds IDPM resource resolution logic inMsalAuth. - Adds/extends unit tests for IDPM configuration and token acquisition behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/hosting_core/test_auth_configuration.py | Adds tests for the new IDPM_RESOURCE configuration field behavior. |
| tests/authentication_msal/test_msal_auth.py | Adds a new test suite covering IDPM resource resolution, client creation, and agentic token acquisition. |
| libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/authorization/auth_types.py | Adds the identity_proxy_manager enum value. |
| libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/authorization/agent_auth_configuration.py | Adds IDPM_RESOURCE to the auth configuration and wiring for kwargs/parameter assignment. |
| libraries/microsoft-agents-authentication-msal/microsoft_agents/authentication/msal/msal_auth.py | Implements IDPM resource resolution, creates MI client for IDPM, and adds IDPM support in get_agentic_application_token. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
adyada
approved these changes
Jun 11, 2026
rodrigobr-msft
approved these changes
Jun 11, 2026
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.
Fixes #393
This pull request adds support for a new authentication type, Identity Proxy Manager (IDPM), to the Microsoft Agents authentication system. It introduces the ability to configure and resolve a resource URL for IDPM token acquisition, updates the configuration and authentication logic to handle the new type, and provides comprehensive tests to ensure correct behavior. The changes are grouped below by theme.
Authentication and Configuration Enhancements:
identity_proxy_manager, to theAuthTypesenum, enabling the use of Identity Proxy Manager for token acquisition.AgentAuthConfigurationclass to support an optionalIDPM_RESOURCEparameter, which specifies the resource URL for IDPM token acquisition. This value can be set via constructor parameter or keyword argument, and defaults toNoneif not provided. [1] [2] [3] [4]_resolve_idpm_resourcestatic method inMsalAuthto determine the correct resource URL for IDPM, defaulting to"api://AzureAdTokenExchange/.default"if not explicitly set, and validating that custom values are absolute URIs.Authentication Logic Updates:
_create_client_applicationmethod inMsalAuthto return aManagedIdentityClientwhen the authentication type isidentity_proxy_manager, aligning it with the behavior for user-managed identities.get_agentic_application_tokenmethod inMsalAuthto support acquiring tokens using IDPM, including resource resolution and error handling for unsupported authentication types.Testing Improvements:
TestMsalAuthIdentityProxyManager) to verify correct handling of the IDPM authentication type, including default and custom resource resolution, client application creation, and token acquisition logic.test_auth_configuration.pyto test defaulting and parameter/kwargs assignment for the newIDPM_RESOURCEproperty inAgentAuthConfiguration.