Add User Federated Identity Credential (UserFIC) flow to ConfidentialClientApplication#5787
Closed
Add User Federated Identity Credential (UserFIC) flow to ConfidentialClientApplication#5787
Conversation
…dentialClientApplication Co-authored-by: neha-bhargava <61847233+neha-bhargava@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add MSAL .NET API for User Federated Identity Credentials
Add User Federated Identity Credential (UserFIC) flow to ConfidentialClientApplication
Feb 25, 2026
tests/Microsoft.Identity.Test.Integration.netcore/HeadlessTests/UserFicIntegrationTests.cs
Outdated
Show resolved
Hide resolved
Contributor
|
Completed the work in another PR |
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.
Adds a first-class MSAL API for acquiring user-scoped tokens using a federated identity credential assertion (e.g., Managed Identity or client credentials token) instead of a password. The underlying OAuth flow uses
grant_type=user_fic,username, anduser_federated_identity_credential.New public API surface
IByUserFederatedIdentityCredentialinterface withAcquireTokenByUserFederatedIdentityCredential(scopes, username, assertionCallback, tokenExchangeScope)AcquireTokenByUserFederatedIdentityCredentialParameterBuilderwith.WithSendX5C()and.WithForceRefresh()ConfidentialClientApplicationnow implementsIByUserFederatedIdentityCredentialUsage pattern (callback-based, lazy assertion evaluation):
Key implementation files
IByUserFederatedIdentityCredential.cs— new interfaceAcquireTokenByUserFederatedIdentityCredentialParameters.cs— internal parametersAcquireTokenByUserFederatedIdentityCredentialParameterBuilder.cs— fluent builderUserFederatedIdentityCredentialRequest.cs— request handler; invokes callback, sendsgrant_type=user_ficbody, stores result in user token cache (same partition as ROPC/OBO)OAuthConstants.cs— addedOAuth2GrantType.UserFicandOAuth2Parameter.UserFederatedIdentityCredentialConfidentialClientExecutor.cs/IConfidentialClientApplicationExecutor.cs— wired new executor overloadPublicAPI.Unshipped.txtfiles updatedTesting
UserFederatedIdentityCredentialTests.cs: happy path, cache hit (callback not re-invoked), force refresh (callback re-invoked), null argument guards, request body validation (grant_type,username,user_federated_identity_credential)UserFicIntegrationTests.cstargetingficadmin@msidlabtse4.onmicrosoft.com/979a25aa-0daf-41a5-bcad-cebec5c7c254using the lab auth cert, covering: initial token from IdP, silent cache hit, force refreshPerformance impact
No impact on existing flows. New flow follows identical code path as ROPC (network + user cache write).
Documentation
Original prompt
This section details on the original issue you should resolve
<issue_title>[Feature Request] Add MSAL .NET API for User FIC</issue_title>
<issue_description>### MSAL client type
Confidential
Problem statement
Internal partners moving off passwords for test automation need a first-class MSAL API to acquire tokens for a specific user using User Federated Identity Credentials (User FIC). The underlying token endpoint flow is ROPC-like but uses a federated user credential JWT instead of a password, via grant_type=user_fic, username, and user_federated_identity_credential.
Proposed solution
Proposed API (DevEx)
Summary
Add support for User Federated Identity Credential (UserFIC) flow to
IConfidentialClientApplication, enabling acquisition of user-scoped tokens using federated identity credential assertions instead of passwords.OAuth Flow:
grant_type:user_ficusername,user_federated_identity_credential(assertion),scopeProposed API
Core Interface
Parameter Builder
Usage Examples
Example 1: Managed Identity as Assertion Source
Example 2: Client Credentials (Certificate) as Assertion Source