Skip to content

Support for FederatedCredentials auth type#353

Merged
axelsrz merged 7 commits intomainfrom
users/robrandao/fic
Apr 7, 2026
Merged

Support for FederatedCredentials auth type#353
axelsrz merged 7 commits intomainfrom
users/robrandao/fic

Conversation

@rodrigobr-msft
Copy link
Copy Markdown
Contributor

This pull request adds support for federated credentials authentication in the Microsoft Agents authentication system, updates the configuration model to handle the new authentication type, and cleans up related code. The most important changes are summarized below.

Federated Credentials Authentication Support

  • Added the federated_credentials authentication type to the AuthTypes enum, enabling the use of federated credentials for authentication.
  • Updated the _create_client_application method in msal_auth.py to handle the new federated_credentials type by acquiring a client assertion using a managed identity client and passing it to MSAL.

Configuration Model Updates

  • Added the FEDERATED_CLIENT_ID field to AgentAuthConfiguration, updated its constructor to accept and initialize this new field, and ensured it is set to None by default when not provided. [1] [2] [3]
  • Updated typing for configuration fields in AgentAuthConfiguration to use str | None instead of Optional[str] for consistency and clarity.

Testing

  • Updated the test_empty_settings test to verify that FEDERATED_CLIENT_ID is None when not set, ensuring coverage for the new configuration field.

Code Cleanup

  • Removed the unused _client_credential_cache attribute from MsalAuth and refactored credential handling to use local variables, simplifying credential management logic. [1] [2]

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for a new federated-credentials authentication mode backed by Managed Identity in the MSAL-based auth provider, and extends the hosting-core auth configuration model to carry the additional client id needed for that flow.

Changes:

  • Added federated_credentials to AuthTypes.
  • Extended AgentAuthConfiguration with FEDERATED_CLIENT_ID (and updated typing to str | None unions).
  • Updated MsalAuth._create_client_application to build a confidential client using a managed-identity-derived client assertion.

Reviewed changes

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

File Description
tests/hosting_core/test_auth_configuration.py Adds assertion that FEDERATED_CLIENT_ID defaults to None.
libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/authorization/auth_types.py Introduces the federated_credentials auth type enum value.
libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/authorization/agent_auth_configuration.py Adds FEDERATED_CLIENT_ID config field and updates type annotations.
libraries/microsoft-agents-authentication-msal/microsoft_agents/authentication/msal/msal_auth.py Implements federated-credentials client creation via Managed Identity client assertion; removes unused credential cache.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings April 2, 2026 22:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rodrigobr-msft rodrigobr-msft marked this pull request as ready for review April 3, 2026 17:42
@rodrigobr-msft rodrigobr-msft requested a review from a team as a code owner April 3, 2026 17:42
@rodrigobr-msft rodrigobr-msft changed the title FederatedCredentials auth type with Managed Identity Support for FederatedCredentials auth type Apr 3, 2026
@axelsrz axelsrz merged commit c95d4ac into main Apr 7, 2026
12 checks passed
@axelsrz axelsrz deleted the users/robrandao/fic branch April 7, 2026 17:51
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.

Reconsider MsalAuth._client_credential_cache usage Add FederatedCredentials as an auth type like in .NET SDK

3 participants