You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a WinUI 3 (WinAppSDK) + .NET 8 based app which uses MSAL .Net for authentication and WebView2 for the main app content. We noticed that when WebView2 is opened after an MASL interactive login (account picker window shown) the app process will not exit after it is closed. With the "Analyze wait chain" option in Task Manager, it shows an svchost process is holding the app process, and this svchost process points to the "TokenBroker" service, which belongs to "Web Account Manager".
I've managed to reproduce it with the minimum code below. This issue seems to only reproduce when both of the following 2 conditions are met:
There is a WebView2 control with a Source property (no matter set via XAML or code-behind).
The MSAL's interactive login window (account picker) is shown.
The app should show bing.com and a "Sign in" button in the top (now if you close the app, the process shuts down normally).
Click "Sign in", when account picker pops up, close the account picker window to cancel login (or sign in with an account. It does not matter as long as the sign in window is shown).
Close the app.
Open Task Manager, search App2.exe in the "Details" tab, the process is still running.
Right click App2.exe, select "analyze wait chain", it shows the svchost process.
Search with the svchost process's id, right click, select "go to services", it shows the "TokenBroker" service.
This issue is really strange since it does not repro when there is not a WebView2 control in the app or the WebView2 control does not have a "Source" property set. I've also noticed with the same code it does not repro on Windows 10 (22H2).
It does not repro with silent login. It seems to have something to do with MSAL + WebView2 combined. Cross posting here in case it is WebView2 related (also posted in MSAL repo here: AzureAD/microsoft-authentication-library-for-dotnet#4967).
Importance
Moderate. My app's user experience is affected, but still usable.
The app should show bing.com and a "Sign in" button in the top (now if you close the app, the process shuts down normally).
Click "Sign in", when account picker pops up, close the account picker window to cancel login (or sign in with an account. It does not matter as long as the sign in window is shown).
Close the app.
Open Task Manager, search App2.exe in the "Details" tab, the process is still running.
Right click App2.exe, select "analyze wait chain", it shows the svchost process.
Search with the svchost process's id, right click, select "go to services", it shows the "TokenBroker" service.
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
What happened?
We have a WinUI 3 (WinAppSDK) + .NET 8 based app which uses MSAL .Net for authentication and WebView2 for the main app content. We noticed that when WebView2 is opened after an MASL interactive login (account picker window shown) the app process will not exit after it is closed. With the "Analyze wait chain" option in Task Manager, it shows an svchost process is holding the app process, and this svchost process points to the "TokenBroker" service, which belongs to "Web Account Manager".
I've managed to reproduce it with the minimum code below. This issue seems to only reproduce when both of the following 2 conditions are met:
The code is also posted in this repo: aries-zhang/WinUI3-MSAL-Demo. Please follow these steps to reproduce:
This issue is really strange since it does not repro when there is not a WebView2 control in the app or the WebView2 control does not have a "Source" property set. I've also noticed with the same code it does not repro on Windows 10 (22H2).
It does not repro with silent login. It seems to have something to do with MSAL + WebView2 combined. Cross posting here in case it is WebView2 related (also posted in MSAL repo here: AzureAD/microsoft-authentication-library-for-dotnet#4967).
Importance
Moderate. My app's user experience is affected, but still usable.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
No response
SDK Version
No response
Framework
WinUI3/WinAppSDK
Operating System
Windows 11
OS Version
No response
Repro steps
The code is also posted in this repo: aries-zhang/WinUI3-MSAL-Demo. Please follow these steps to reproduce:
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
Regression
No, this never worked
Last working version (if regression)
No response
Internal Tracking Number: 57235930
The text was updated successfully, but these errors were encountered: