After updating to Azure.Identity from 1.10 to 1.11, I can no longer authenticate console application.

Doug Mendenhall 25 Reputation points
2024-06-24T17:08:01.3666667+00:00

I have a small LOB console application that needs to authenticate against Entra ID. The console app uses an IPublicClientApplication for acquiring the token interactively (since I need an MFA claim). Doing it this way, would trigger a pop-up window to select the user. This code looks like the below and worked fine using Azure.Identity up to version 1.10.4:

var app = PublicClientApplicationBuilder.Create(ClientAppId)
    .WithAuthority("https://login.windows.net", tenantDomain, true)
    .Build();
Microsoft.Identity.Client.AuthenticationResult? result = await app.AcquireTokenInteractive(scopes)
          .ExecuteAsync();

After updating to 1.11.x (and also 1.12.x), the same code opens the challenge in a new web browser tab and when returning to the application throws an exception: "AADSTS7000218: The request body must contain the following parameter: 'client_assertion' or 'client_secret'."

It's a public client app which doesn't take a client secret. I've already double checked the "Allow public client flows" in my Entra App registration and my manifest includes an "allowPublicClient": true reference (as is suggested in the Stack Overflow article that seems to be THE answer for this exception). If I downgrade the NuGet package back to Azure.Identity 1.10, it works again.

I can't find any reference to breaking changes between versions. I'm not sure if this is a bug or what I can do to reconfigure my application to use the newer SDK.

Microsoft Security | Microsoft Entra | Microsoft Entra ID
Developer technologies | C#
Developer technologies | C#

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.

Developer technologies | ASP.NET Core | Other
0 comments No comments

1 answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    1 deleted comment

    Comments have been turned off. Learn more

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.