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] Log-in window is sometimes left running by itself/orphaned

See original GitHub issue

I’m experimenting with WinappSDK / WinUI3. Coming from UWP, one odd thing I’ve noticed is sometimes when my app closes/crashes, the MSAL sign-in window is left running on its own/orphaned. Why does that happen and is there a way to prevent it?

Which version of MSAL.NET are you using? 4.49.1-preview

Platform WinappSDK 1.3 expermintal1, WinUI3

** Repro ** It repros fine with a console app.

    static async Task Main(string[] args)
    {
            var pca = PublicClientApplicationBuilder
                .Create("4b0db8c2-9f26-4417-8bde-3f0e3656f8e0")
                .WithRedirectUri("http://localhost")
                .WithBrokerPreview(true)
                .Build();

            var result = pca.AcquireTokenInteractive(new[] { "user.read" })
                .WithParentActivityOrWindow(GetConsoleOrTerminalWindow())
                .ExecuteAsync();
           
            // WAM account picker pops up here.
            await Task.Delay(1000);

            // app crashes, but instead of closing, both console and Account picker remain on the screen. Console is modal.
            throw new Exception("oh no");
    }

Actual: when app crashes, the account picker stays on screen and so does the console window, which remains modal. Account Picker seems to be blocking the window from closing after the crash. App appears “frozen”

Expected: on app crash, Account picker and app should close.

Issue Analytics

  • State:open
  • Created 7 months ago
  • Comments:19 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
myokeehcommented, May 11, 2023
1reaction
bgavrilMScommented, May 18, 2023

@localden - the account picker is a windows component separate from WAM. It’s official name is Accounts Settings Pane. It is owned by Windows. It is required when combining AAD and MSA accounts.

If MSAL knows we deal only with “work and school” accounts, then it bypasses this picker and goes directly to WAM’s AAD plugin, which behaves better in scenarios where you have a login hint etc.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Orphaned processes when terminal is force-closed by ...
The computer didn't restart because my other apps are still in their previous state, but Windows Terminal is just closed. Maybe it crashed?...
Read more >
How do I remove an "orphaned" window from a closed ...
Currently, I have a login window from the Screen Sharing application that's been spinning the spoked progress wheel next to "Connecting..." for ...
Read more >
[SOLVED] "Ghost" or Orphaned Window Won't Go Away ( ...
The problem is that when they stop working I'm left with a "ghost" window that ... Plasma then restarts itself and the ghost...
Read more >
How to Fix Orphaned Users in SQL Server - sqlity.net
Sometimes that login-user association breaks. That can for example happen, when a backup is restored on a different server. In this article, we ......
Read more >
Troubleshoot orphaned users - SQL Server Always On
Orphaned users in SQL Server occur when a database user is based on a login in the master database, but the login no...
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