Skip to content

[Bug]: Silent WAM entra token acquisition doesn't workΒ #664

Closed

Description

Description

MsalSilentTokenProvider always receives the non-broker IPublicClientApplication, so it can never acquire tokens
silently from the WAM broker cache. This means every invocation requires interactive authentication when the broker is enabled and ARTIFACTS_CREDENTIALPROVIDER_RETURN_ENTRA_TOKENS is set (session cache not used).

In MsalTokenProvidersFactory.cs, two separate IPublicClientApplication instances are created:

  • app - without broker
  • appInteractiveBroker - with broker

In MsalTokenProviders.cs, the silent provider receives app:

yield return new MsalSilentTokenProvider(app, logger);              // non-broker
yield return new MsalBrokerInteractiveTokenProvider(appInteractiveBroker, logger); // broker

Because app has IsBrokerEnabled = false, the #if INCLUDE_BROKER block in MsalSilentTokenProvider that adds
OperatingSystemAccount never activates, and GetAccountsAsync() never queries WAM. The MSAL file cache is also empty because broker interactive auth stores tokens in WAM's cache, not the file cache.

Environment (OS/platform or image)

Windows 11

Tool versions

credprovider 2.0.1

Client/protocol path in use

None

Credential Provider logs

No response

Additional context

No response

Activity

  1. embetten commented on May 7, 2026

    @embetten
    Contributor

    This fix was published as pre-release https://github.com/microsoft/artifacts-credprovider/releases/tag/v2.0.2 please try it out and let me know if this resolves the issue!

  2. embetten commented on May 12, 2026

    @embetten
    Contributor

    closing - released and switched to latest please reopen if you run into any further issues. We will have a follow up version to address the WSL issue addressed in 676

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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