MicrosoftEdge / MicrosoftEdge/WebView2Feedback

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

Open
#4,672 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

What happened?

I have the following scenario: my machine has two accounts

  • "michael" who is a local admin
  • "basil" who is a standard user

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported administrator/non-administrator reproduction scenario using WebView2 Runtime 126.0.2592.87 and SDK 1.0.1518.46 on Windows 10 or 11. Compare the app and WebView2 child-process identities, then establish whether the behavior is expected or a confirmed bug; the issue is done when that outcome and any supported guidance are documented.

Written by the indexing model from the issue text.

Assessment

Domain
desktop, operating-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.