MicrosoftEdge / WebView2Feedback

Feedback and discussions about Microsoft Edge WebView2
https://aka.ms/webview2
437 stars 51 forks source link

[Problem/Bug]: WebView creation fails when app is started using "Run as administrator" and explicit admin credentials #4672

Open Urmeli0815 opened 2 months ago

Urmeli0815 commented 2 months ago

What happened?

I have the following scenario: my machine has two accounts

My app was installed by "michael" for all users using elevated rights.

Now "basil" logs in. He rights-click on our app-icon and selects "Run as administrator". He now enters the credentials from "michael". The app start fails with this error message from WebView2:

image

We set the UserDataFolder of WebView2 to a LocalAppData-Path of the running user (which in this case is "michael"). But it seems that child processes of WebView2 don't use the same user. In fact they run under the "basil" user as can be seen here:

image

My expectation would be that the child processes get launched with the same user as the app that contains the WebView2.

Can you clarify if this is expected behavior or if this is a bug?

Importance

Moderate. My app's user experience is affected, but still usable.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

126.0.2592.87

SDK Version

1.0.1518.46

Framework

Win32

Operating System

Windows 10, Windows 11

OS Version

10.0.26120

Repro steps

The problem should be reproducible with any app using WebView2. It just depends on the described admin/non-admin user scenario.

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

Urmeli0815 commented 2 months ago

Probably the same problem as in https://github.com/MicrosoftEdge/WebView2Feedback/issues/3128 but I decided to create a new issue with a more detailed description.