question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] WebView2 fails to load and WebBrowser does not change the title

See original GitHub issue

Logs and Network traces N/A

Which Version of MSAL are you using ? MSAL 4.31.0

Platform net472

What authentication flow has the issue?

  • Desktop / Mobile
    • Interactive

Is this a new or existing app? c. This is a new app or experiment

Repro

using Microsoft.Identity.Client;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static async Task Main(string[] args)
        {
            var clientId = "872cd9fa-d31f-45e0-9eab-6e460a02d1f1";
            var scopes = new[] { "User.Read" };

            var webViewOptions = new EmbeddedWebViewOptions
            {
                Title = "Hello, World!"
            };

            var pca = PublicClientApplicationBuilder.Create(clientId).Build();

            var result = await pca.AcquireTokenInteractive(scopes)
                .WithUseEmbeddedWebView(true)
                .WithEmbeddedWebViewOptions(webViewOptions)
                .ExecuteAsync();
        }
    }
}

Expected behavior The embedded web view browser window appears with the title of “Hello, World!”.

Actual behavior The webpage title is shown (default). image

Possible Solution Unknown.

Additional context/ Logs / Screenshots None.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
bgavrilMScommented, May 17, 2021

The loading is a bug.

1reaction
bgavrilMScommented, May 17, 2021

Works with WebView2 - see https://aka.ms/msal-net-webview2 but not with the old WebBrowser

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webview2 / VB .NET - Can't get webpage to load
1 Answer 1 · In Solution Explorer, right-click <project name> · Select Manage NuGet Packages... · Click Browse · In the search box,...
Read more >
WebView2 error message - Microsoft Power BI Community
Solved: Hello All, Since my IT team installed WebView2, this is the second time in the last couple weeks that this has happened....
Read more >
Microsoft Edge Webview2 Runtime is a huge problem
Uninstalled that webview2 and it would not load at all. I reinstalled it and still the same issue. Found that the process is...
Read more >
Navigation events for WebView2 apps
WebView2 starts loading content for the new page. The navigation causes the history of WebView2 to update.
Read more >
Microsoft Edge Webview2 Runtime can't be uninstalled.
Microsoft Edge Webview2 Runtime keeps getting installed on my PC. I can't uninstall it as next day it somehow installs itself back.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found