electron: [Bug]: Linkedin loaded in WebView prompting Windows users to "Sign in with your passkey"

Preflight Checklist

Electron Version

28.2.0

What operating system are you using?

Windows

Operating System Version

Windows 11 Version 22H2

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

The user can sign in using their username and password.

Actual Behavior

The user attempts to sign in, the Windows Security “Sign in with your passkey” popup appears, the user clicks Cancel, the cycle repeats.

Screenshot 2024-02-29 112116

Testcase Gist URL

No response

Additional Information

Linkedin is the only site this behavior can be observed on. The URL is being loaded through a webview. The following electron settings are in use:

const mainWindow = new BrowserWindow({
    icon: __dirname + "/images/favicon.icns",
    webPreferences: {
      webviewTag: true,
      preload: path.join(app.getAppPath(), 'src/scripts/nest.js'),
      nativeWindowOpen: false,
      contextIsolation: true,
      sandbox: false
    },
    maximizable: false,
    frame: false,
    backgroundColor: "#FFF"
  });

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (1 by maintainers)

Most upvoted comments

I have an update! After playing around with the requests being sent by Linkedin and blocking certain ones until I got somewhere, I managed to come up with this work around code. Ideally the electron team still implements a way to block this passkey request, however for those in need of a solution for the particular case of Linkedin, let me know if this works:

// when a webview is created, add the following code to it
app.on("web-contents-created", (e, wc) => {
  // before a webview makes a request
  wc.session.webRequest.onBeforeRequest((details, callback) => {
    // if the request url matches the url which appears to be sending the passkey request
    if(details.url.includes("checkpoint/pk/initiateLogin")) {
      // log the blocked url
      console.log("\x1b[31m", "Blocked", details.url)
    } else {
      // if the request url doesn't match the misbehaving url, allow the callback as usual
      callback({})
    }
  })
})

I’m also seeing this issue with LinkedIn. It only occurs with Electron, not with Edge or Chrome

@VerteDinde what can we do to appeal and reopen this ticket please? 😃

@joelwright-dev You are awesome!! Thank you for sharing! This worked 😃

@joelwright-dev thanks! we will try this and I will write back if it works 😃

Same as this one I’ve created this a few months ago: https://github.com/electron/electron/issues/40812