Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With Hyper terminal, Windows Hello Auth appears in background #4

Closed
OscBacon opened this issue Apr 1, 2019 · 32 comments · Fixed by #27
Closed

With Hyper terminal, Windows Hello Auth appears in background #4

OscBacon opened this issue Apr 1, 2019 · 32 comments · Fixed by #27

Comments

@OscBacon
Copy link

OscBacon commented Apr 1, 2019

Whenever I call sudo in hyper terminal, the authentication window appears in the background, and I have to switch to it with with Alt + Tab.

@RedBeard0531
Copy link

This also happens for mintty and cmd

@nullpo-head
Copy link
Owner

Unfortunately, that doesn't reproduce in my environment. I'm glad if you could find out how to reproduce it. I have experienced it once, so I'm sure that happens in some situation, though.

@haotian-wang
Copy link

This also happens for my Windows Terminal, cmd, and powershell.
Windows version: 1903 (18362.356)

@piotrmocko
Copy link

Same issue on Windows Terminal 1.0 on Windows version: 1909.
But it works on ConEmu.

@nullpo-head
Copy link
Owner

Hi, I've encountered the same situation in one of my laptops, which runs Windows Terminal 1.0 on Windows 1909. Restarting the machine solved the problem in my case.
Please try restarting your machine when you have this problem. If the problem persists, I think it's worth submitting a bug ticket to somewhere of .NET Framework.

@piotrmocko
Copy link

I have this problem since I started using Windows Terminal 0.6 so it is already a few months and restart doesn't help.

@piotrmocko
Copy link

I've opened an issue in Windows Terminal issues tracker. Please upvote it and add comments with your environments if you experience the same issue microsoft/terminal#6268

@nullpo-head
Copy link
Owner

I've opened an issue in .Net Developer community. https://developercommunity.visualstudio.com/content/problem/1057256/windows-hellos-keycredentialmanager-popup-appears.html I guess it's a problem of .NET API. Your votes will help to prioritize it. Thanks.

@JacobDB
Copy link

JacobDB commented Nov 13, 2020

@nullpo-head looks like as of 11/4 that issue was closed 😕

@piotrmocko
Copy link

After updating Windows 10 to 20H2 and installing the following two updates, the problem has disappeared for me

@JacobDB
Copy link

JacobDB commented Nov 13, 2020

@piotrmocko I just get "This update is no applicable for your system" when I try to install either of those (tried by x86 and x64). Running 20H2 on a brand new machine that I set up yesterday.

@piotrmocko
Copy link

These updates are in my Windows 10 updates history and I'm 90% sure that after installing them the issue was resolved. I did not download them from the Microsoft website. They have appeared in my Windows Update

@jonaskuske
Copy link
Contributor

I have both of these installed and it changes nothing. :(

@piotrmocko
Copy link

Unfortunately, it stopped working for me too. I did not install any new update. So, I was lucky to have it working for a few days.

@ram02z
Copy link

ram02z commented Jan 21, 2021

Anyone have a fix?

@crispinb
Copy link

crispinb commented Mar 4, 2021

This happens for me with every invocation (though I'm using Windows Terminal). Reboots don't make a difference in my case.

@y-batsianouski
Copy link

Same issue with Win10 20H2 with all updated installed and Windows Terminal 1.6.10571.0

@PhyX-Meow
Copy link

Any news?

@danepowell
Copy link

Seems like this could be the relevant upstream issue: microsoft/terminal#2988

@TrentonAdams
Copy link

This pam module doesn't really do much if it doesn't foreground the windows hello prompt.

@just4747
Copy link

just4747 commented Oct 20, 2021

So was this never fixed? I am on Windows 11 now and just like on 10, whenever my SafeInCloud PW manager app/Chrome plug-in requires Windows Hello Fingerprint authentication to auto-fill browser passwords, the Windows Hello Fingerprint Auth Window (most of the time) comes up in the background of other windows (usually the separate SafeInCloud login window itself) and I have to manually click the Hello window from the taskbar to get it in focus/foreground before it will recognize that I am putting my fingerprint on the reader. Super frustrating.

The only way I've mostly fixed this (workaround) for now is to use the Windows app DeskPins which runs in the taskbar and you can set up an auto-pin rule in its settings where anytime it sees a specific window (you specify the app/event), it will auto-pin it so that it forces it to stay in the foreground over any other app. You can set up a rule specifically for the Windows Security/Windows Hello authentication window.
This actually solves the problem of it automatically going right to the background unless you have another app pinned with DeskPins, but otherwise it works so far.

@nullpo-head
Copy link
Owner

The only way I've mostly fixed this (workaround) for now is to use the Windows app DeskPins which runs in the taskbar and you can set up an auto-pin rule in its settings where anytime it sees a specific window (you specify the app/event), it will auto-pin it so that it forces it to stay in the foreground over any other app. You can set up a rule specifically for the Windows Security/Windows Hello authentication window.

Oh, perhaps does it mean the WindowsHello windows can be manipulated with win32API just like normal windows? I thought it cannot be just like you cannot touch the UAC dialog window by win32 API. If it's possible simply setting the Windows Hello window foreground might solve the problem. Anyone interested in making a PR? 😋

@plusls
Copy link

plusls commented Nov 4, 2021

Any progess?

@jonaskuske
Copy link
Contributor

jonaskuske commented Nov 15, 2021

Just hacked around a little, the Windows Hello window can be brought to the foreground through a simple PowerShell script!

$sig = '[DllImport("user32.dll")] public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);'
Add-Type -MemberDefinition $sig -name NativeMethods -namespace Win32
$hwnd = (Get-Process CredentialUIBroker).MainWindowHandle
[Win32.NativeMethods]::ShowWindowAsync($hwnd, 2) # minimize
[Win32.NativeMethods]::ShowWindowAsync($hwnd, 9) # restore, brings to foreground

And there's also a native Rust crate for the Windows API, so this might actually be quite doable! Will give it a shot soon :)

@just4747
Copy link

Just hacked around a little, the Windows Hello window can be brought to the foreground through a simple PowerShell script!

$sig = '[DllImport("user32.dll")] public static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);'
Add-Type -MemberDefinition $sig -name NativeMethods -namespace Win32
$hwnd = (Get-Process CredentialUIBroker).MainWindowHandle
[Win32.NativeMethods]::ShowWindowAsync($hwnd, 2) # minimize
[Win32.NativeMethods]::ShowWindowAsync($hwnd, 9) # restore, brings to foreground

And there's also a native Rust crate for the Windows API, so this might actually be quite doable! Will give it a shot soon :)

How would you use this exactly? Do you mean create this as a ps1 file and run it in PS once and it takes care of the issue?

@jonaskuske
Copy link
Contributor

@just4747 You can't use it, it was just a proof-of-concept showing that the Win32 APIs can be used to interact with the Windows Hello window.

To actually make it usable, the .exe used by WSL-Hello-sudo needs to call the respective APIs, which I implemented in #27.
If you want, you can clone and build my branch https://github.com/jonaskuske/WSL-Hello-sudo/tree/fix/hello-foreground, run the install.sh and you'll have the fixed version that moves the Hello popup to the foreground. :)

@nullpo-head
Copy link
Owner

I guess @jonaskuske just has fixed this long-standing issue. Kudos to @jonaskuske! Please report if the problem still persists.

@just4747
Copy link

I'm confused, how is the fix implemented for people watching this/having the issue? Is there some update we can integrate or something? Sorry - unsure how this works.

@danepowell
Copy link

Is there some update we can integrate?

Install / upgrade to the new release: https://github.com/nullpo-head/WSL-Hello-sudo/releases/tag/v1.4.0

@just4747
Copy link

just4747 commented Nov 23, 2021

Is there some update we can integrate?

Install / upgrade to the new release: https://github.com/nullpo-head/WSL-Hello-sudo/releases/tag/v1.4.0

Thanks. New release of what exactly? Isn't this all part of the Windows Hello part of Windows 11?
Is this installable on a regular Windows installation or is this for Linux only/other? I'm sorry, I'm not familiar with what to do with the files on from github. OR is this specific to this Hyper Terminal software? I thought this was regarding the Windows Hello issue in general on Windows 11. I am having the problem with Windows Hello with any app that utilizes it for authentication.

@jonaskuske
Copy link
Contributor

@just4747

This is only for Linux, the entire (and only) purpose of this tool is to open Windows Hello whenever you run the sudo command in Linux.

I thought this was regarding the Windows Hello issue in general on Windows 11. I am having the problem with Windows Hello with any app that utilizes it for authentication.

I'm not aware of any general issue like that. I only have this issue with the Linux integration, which the latest update here fixes. It already works perfectly fine when other applications open Windows Hello, like Microsoft Edge or 1Password.

@just4747
Copy link

@just4747

This is only for Linux, the entire (and only) purpose of this tool is to open Windows Hello whenever you run the sudo command in Linux.

I thought this was regarding the Windows Hello issue in general on Windows 11. I am having the problem with Windows Hello with any app that utilizes it for authentication.

I'm not aware of any general issue like that. I only have this issue with the Linux integration, which the latest update here fixes. It already works perfectly fine when other applications open Windows Hello, like Microsoft Edge or 1Password.

Oh - that's unfortunate. I have this exact issue every single day with the Windows Hello fingerprint authentication popup in Windows 11, just using it with native Windows apps like SafeInCloud. Every time the Windows Security authentication window pops up it goes immediately to the background behind the prior app's window. I thought this was about this issue in general (at least one of the other now closed threads mentioned it). Oh well..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.