Skip to content

FmiPath is not persisted when copying/reinitializing AcquireTokenOptions #3336

Closed
@trwalke

Description

@trwalke

Microsoft.Identity.Web Library

Microsoft.Identity.Web

Microsoft.Identity.Web version

3.8.3

Web app

Sign-in users and call web APIs

Web API

Protected web APIs call downstream web APIs

Token cache serialization

In-memory caches

Description

When using AuthorizationHeaderProvider.CreateAuthorizationHeaderForAppAsync(...new AuthorizationHeaderProviderOptions() { AcquireTokenOptions = options }...), The FMI path added to AcquireTokenOptions is not persisted in the token acquisition flow. Somewhere in the IdWeb code, the TokenAcquisitionOptions provided to this api is copied/reinitialized and the FMI path property is not added to the new instance.

See

private static TokenAcquisitionOptions? GetEffectiveTokenAcquisitionOptions(AcquireTokenOptions? tokenAcquisitionOptions, string? authenticationScheme, CancellationToken cancellationToken)
{

Reproduction steps

initialize a token acquirer and attempt to call CreateAuthorizationHeaderForAppAsync

var options = new AcquireTokenOptions() { FmiPath = "somepath" };
string result = await authorizationHeaderProvider.CreateAuthorizationHeaderForAppAsync("https://graph.microsoft.com/.default",
    new AuthorizationHeaderProviderOptions() { AcquireTokenOptions = options });

using fiddler, you will see that the fmi path is not sent to the endpoint in the http request message

Error message

No response

Id Web logs

No response

Relevant code snippets

Most likely where is issue is happening
See https://github.com/AzureAD/microsoft-identity-web/blob/2e8ba588d5f5a98446c123aec7b374b14fe8bea7/src/Microsoft.Identity.Web.TokenAcquisition/TokenAcquirer.cs#L71-L72

Regression

No response

Expected behavior

IdWeb should send the fmi path to the ests endpoint when acquiring tokens and the fmi path is set in the TokenAcquisitionOptions

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions