AcquireTokenInteractive with WithUseEmbeddedWebView stopped working after upgrading library.

Jiya desai 51 Reputation points
2024-07-24T17:32:54.5866667+00:00

Hi,

[Urgent]

One of my live Microsoft Store App (Written in UWP) is using Microsoft.Identity.Client nuget library. Following code was working perfectly well until i upgraded library from version 4.58.1 to 4.62.0

 PublicClientApplicationBuilder.Create(ClientId)
   .WithAuthority(AzureCloudInstance.AzurePublic, Tenant)
   .WithRedirectUri(redirectUri)
   .Build();


authResult = await app.AcquireTokenInteractive(scopes)
         .WithAccount(accounts.FirstOrDefault())
         .WithPrompt(Prompt.SelectAccount)
         .WithUseEmbeddedWebView(true)
         .ExecuteAsync();

After library version upgrade it starts throwing error

Error Acquiring Token Silently: To enable the embedded webview on Windows, reference
Microsoft.Identity.Client.Desktop and call the extension method 
.WithWindowsEmbeddedBrowserSupport().	

But when i try to add Microsoft.Identity.Client.Desktop in my UWP app, it says library is not compatible with project.

NU1202: Package Microsoft.Identity.Client.Desktop 4.62.0 is not compatible with
uap10.0.17763 (UAP,Version=v10.0.17763) / win10-x86-aot. 

I don't understand what to do,
kindly advise.

Microsoft Identity Manager
Microsoft Identity Manager
A family of Microsoft products that manage a user's digital identity using identity synchronization, certificate management, and user provisioning.
661 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,642 questions
Universal Windows Platform (UWP)
{count} votes