.Net MAUI - Microsoft.Identity.Client with latest Version="4.66.2" is giving the exception as "To enable the embedded webview on Windows, reference Microsoft.Identity.Client.Desktop and call the extension method .WithWindowsEmbeddedBrowserSupport()."
Hello,
I was using the Microsoft.Identity.Client with version 4.60.3 is giving the vulnerable error. Hence I recently upgraded my Microsoft.Identity.Client version from "4.60.3" to 4.66.2.
Previous versions
<PackageReference Include="Microsoft.Identity.Client" Version="4.60.3" />
<PackageReference Include="Microsoft.Identity.Client.Extensions.Msal" Version="4.57.0" />
Upgraded versions
<PackageReference Include="Microsoft.Identity.Client" Version="4.66.2" />
<PackageReference Include="Microsoft.Identity.Client.Extensions.Msal" Version="4.66.2" />
After the upgradation, my app is failing the authentication and throwing the exceptions as
"To enable the embedded webview on Windows, reference Microsoft.Identity.Client.Desktop and call the extension method .WithWindowsEmbeddedBrowserSupport()."
And when I tried to add the package as it suggested in the error I'm not able to find the method ".WithWindowsEmbeddedBrowserSupport()"
My existing Authentication logic is as below,
public IPublicClientApplication mPublicClientApplication;
mPublicClientApplication = PublicClientApplicationBuilder.Create(ClientId)
.WithAuthority(Authority)
.WithRedirectUri(RedirectUri)
.Build();
AttachTokenCache(mPublicClientApplication.UserTokenCache);
AuthenticationResult result = await mPublicClientApplication.AcquireTokenInteractive(Scopes)
.WithUseEmbeddedWebView(true)
.ExecuteAsync();
Due to this we are unable to proceed further to use the app.
Need a quick help in this as it is a blocker for the app usage.
Thanks in advance