Skip to content

[Bug] Improve AcquireTokenSilent logging and FOCI handling #4988

@bgavrilMS

Description

@bgavrilMS

Library version used

4.66.1

.NET version

net8

Scenario

ConfidentialClient - web site (AcquireTokenByAuthCode)

Is this a new or an existing app?

None

Issue description and reproduction steps

cca.AcquireTokenSilent(scopes, Account) when no RT is in the cache

Actual logs:

[11:58:53:807][Informational] False MSAL 4.66.1.0 [a8964989-5aee-4f66-adf3-e83e75857d3c] === Token Acquisition (SilentRequest) started:
         Scopes: https://management.azure.com//.default
        Authority Host: login.microsoftonline.com
[11:58:53:810][Informational] False MSAL 4.66.1.0 [a8964989-5aee-4f66-adf3-e83e75857d3c] [Region discovery] Not using a regional authority.
[11:58:53:811][Warning] False MSAL 4.66.1.0 [a8964989-5aee-4f66-adf3-e83e75857d3c] No app metadata found. Returning unknown.
[11:58:53:819][Warning] False MSAL 4.66.1.0 [a8964989-5aee-4f66-adf3-e83e75857d3c] Refreshing the RT failed. Is the exception retryable? False. Is there an AT in the cache that is usable? False
[11:58:53:819][Warning] False MSAL 4.66.1.0 [a8964989-5aee-4f66-adf3-e83e75857d3c] Failed to refresh the RT and cannot use existing AT (expired or missing).
[11:58:53:836][Error] False MSAL 4.66.1.0 [a8964989-5aee-4f66-adf3-e83e75857d3c] Exception type: Microsoft.Identity.Client.MsalUiRequiredException
, ErrorCode: no_tokens_found

Expected: It should be clearer that there is no RT in the cache and no warnings should be there.

Relevant code snippets

No response

Expected behavior

No response

Identity provider

Microsoft Entra ID (Work and School accounts and Personal Microsoft accounts)

Regression

No response

Solution and workarounds

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions