Skip to content

[Bug] MsalUiRequiredException.Classification does not seem to report useful data #5187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
zachcwillson opened this issue Mar 12, 2025 · 2 comments
Labels
needs attention Delete label after triage public-client untriaged Do not delete. Needed for Automation

Comments

@zachcwillson
Copy link

Library version used

4.67.2, 4.69.1

.NET version

.Net Core 8.0.*

Scenario

PublicClient - desktop app

Is this a new or an existing app?

The app is in production, I haven't upgraded MSAL, but started seeing this issue

Issue description and reproduction steps

We observe that when we get MsalUiRequiredException, if we attempt to inspect .Classification, it always returns back as UiRequiredExceptionClassification.None.

As SubError is internal, we have no way to identify why we are hitting MsalUiRequiredException.

We see these error codes and error tags:

Error Code Error Tag
3399614476 0x2142008D
3399614467 0x21447008
3399548929 0x1E50C30C
3399614467 0x1E50C30C
3399548929 0x1F6DD65E

But we have little understanding of why interactive auth was required.

Over the last 28 days, we have hit "None" for MsalUiRequiredException on 691 unique devices/customers

Relevant code snippets

try
{
    await publicClient.AcquireTokenSilent(scopes, PublicClientApplication.OperatingSystemAccount).ExecuteAsync(ct);
}
catch (MsalUiRequiredException e)
{
    Console.WriteLine(e.Classification);
}

Expected behavior

Either MsalUiRequiredException.Classification contains relevant data, or SubError is moved from internal to public

Identity provider

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

Regression

All

Solution and workarounds

None that we are aware of.

@zachcwillson zachcwillson added needs attention Delete label after triage untriaged Do not delete. Needed for Automation labels Mar 12, 2025
@zachcwillson zachcwillson changed the title [Bug] MsalUiRequiredException.UiRequiredExceptionClassification does not seem to report useful data [Bug] MsalUiRequiredException.Classification does not seem to report useful data Mar 12, 2025
@zachcwillson
Copy link
Author

One thing to note is we are using the Broker extension.

@bgavrilMS
Copy link
Member

bgavrilMS commented Mar 27, 2025

We never bridged the exception classification from interop to MSAL. So I recommend treating this as a bug.

For reference, this is the classification

and this is where it's computed if MSAL isn't using the runtime

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs attention Delete label after triage public-client untriaged Do not delete. Needed for Automation
Projects
None yet
Development

No branches or pull requests

2 participants