<p dir="auto"><strong>Expected Behavior</strong><br>
Use the session.setProxy function of a window to set a user:pass authenticated proxy. Load URL in that window. Expect that app.login event is triggered and request is made.<br>
<strong>Actual behavior</strong><br>
Set session proxy to a user:pass authenticated proxy, loadURL requests fail with status "failed" in dev tools. App.login event never called.<br>
<strong>To Reproduce</strong><br>
Create a window, use the session setProxy function to set a user:pass authenticated proxy. Then try to load ANY url in that window.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="win.webContents.session.setProxy({
          proxyRules: `http://user:pass@ip:port`
        }, () =&gt; {});
 }
//Requests fail status &quot;failed&quot;
win.loadURL('https://whatismyipaddress.com');
//This is NOT reached
app.on('login', function (event, request, authInfo, callback) {
  if (authInfo.isProxy) {
    log.info(`HI ${JSON.stringify(authInfo)}`)
    // callback('username', 'password');
  }
})"><pre class="notranslate"><code class="notranslate">win.webContents.session.setProxy({
          proxyRules: `http://user:pass@ip:port`
        }, () =&gt; {});
 }
//Requests fail status "failed"
win.loadURL('https://whatismyipaddress.com');
//This is NOT reached
app.on('login', function (event, request, authInfo, callback) {
  if (authInfo.isProxy) {
    log.info(`HI ${JSON.stringify(authInfo)}`)
    // callback('username', 'password');
  }
})
</code></pre></div>
<p dir="auto">Working code with IP authenticated proxies</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="win.webContents.session.setProxy({
          proxyRules: `http://ip:port`
        }, () =&gt; {});
 }
//Requests succeed
win.loadURL('https://whatismyipaddress.com');
//This is reached
app.on('login', function (event, request, authInfo, callback) {
  if (authInfo.isProxy) {
    log.info(`HI ${JSON.stringify(authInfo)}`)
    // callback('username', 'password');
  }
})"><pre class="notranslate"><code class="notranslate">win.webContents.session.setProxy({
          proxyRules: `http://ip:port`
        }, () =&gt; {});
 }
//Requests succeed
win.loadURL('https://whatismyipaddress.com');
//This is reached
app.on('login', function (event, request, authInfo, callback) {
  if (authInfo.isProxy) {
    log.info(`HI ${JSON.stringify(authInfo)}`)
    // callback('username', 'password');
  }
})
</code></pre></div>
<p dir="auto">This code is working for me with IP authenticated proxies. App.login is triggered and the request completes as expected. Just user:pass proxies that are the issue.</p>
<p dir="auto">When opening chrome dev tools I can see the requests being attempted and returning status "failed".</p>
<p dir="auto"><strong>Additional Information</strong></p>
<p dir="auto">I opened this issue and it was closed, marked as a duplicate of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="308769567" data-permission-text="Title is private" data-url="https://github.com/electron/electron/issues/12443" data-hovercard-type="issue" data-hovercard-url="/electron/electron/issues/12443/hovercard" href="https://github.com/electron/electron/issues/12443">#12443</a></p>
<p dir="auto">This is a different case and not a duplicate. Please do not close this! Thank you.</p>
<p dir="auto"><em>edited</em></p>
<ul dir="auto">
<li>Electron version :2.0.1</li>
<li>Platform: MacOS High Sierra 10.13.3</li>
</ul>
<h3 dir="auto">Preflight Checklist</h3>

<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the issue tracker for an issue that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Issue Details</h3>
<ul dir="auto">
<li><strong>Electron Version:</strong>
<ul dir="auto">
<li>7.0.0</li>
</ul>
</li>
<li><strong>Operating System:</strong>
<ul dir="auto">
<li>macOS</li>
</ul>
</li>
<li><strong>Last Known Working Electron version:</strong>
<ul dir="auto">
<li>6.1.2</li>
</ul>
</li>
</ul>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto"><a href="https://github.com/electron/electron/blob/v7.0.0/docs/api/web-contents.md#event-login">https://github.com/electron/electron/blob/v7.0.0/docs/api/web-contents.md#event-login</a> triggered</p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">login event not triggered</p>
<h3 dir="auto">To Reproduce</h3>
<p dir="auto">run following code</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const {app, BrowserWindow} = require('electron')
app.once('ready', async () =&gt; {
  win = new BrowserWindow()
  app.on('login', console.log)
  win.webContents.on('login', console.log)
  win.webContents.once('did-finish-load', async () =&gt; {
    const html = await win.webContents.executeJavaScript('document.documentElement.innerHTML')
    console.log(html)
    app.quit()
  })
  await win.webContents.loadURL('https://httpbin.org/basic-auth/user/passwd')
})"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-kos">{</span>app<span class="pl-kos">,</span> BrowserWindow<span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'electron'</span><span class="pl-kos">)</span>
<span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">once</span><span class="pl-kos">(</span><span class="pl-s">'ready'</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-s1">win</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">BrowserWindow</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
  <span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'login'</span><span class="pl-kos">,</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-c1">log</span><span class="pl-kos">)</span>
  <span class="pl-s1">win</span><span class="pl-kos">.</span><span class="pl-c1">webContents</span><span class="pl-kos">.</span><span class="pl-en">on</span><span class="pl-kos">(</span><span class="pl-s">'login'</span><span class="pl-kos">,</span> <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-c1">log</span><span class="pl-kos">)</span>
  <span class="pl-s1">win</span><span class="pl-kos">.</span><span class="pl-c1">webContents</span><span class="pl-kos">.</span><span class="pl-en">once</span><span class="pl-kos">(</span><span class="pl-s">'did-finish-load'</span><span class="pl-kos">,</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-k">const</span> <span class="pl-s1">html</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">win</span><span class="pl-kos">.</span><span class="pl-c1">webContents</span><span class="pl-kos">.</span><span class="pl-en">executeJavaScript</span><span class="pl-kos">(</span><span class="pl-s">'document.documentElement.innerHTML'</span><span class="pl-kos">)</span>
    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">html</span><span class="pl-kos">)</span>
    <span class="pl-s1">app</span><span class="pl-kos">.</span><span class="pl-en">quit</span><span class="pl-kos">(</span><span class="pl-kos">)</span>
  <span class="pl-kos">}</span><span class="pl-kos">)</span>
  <span class="pl-k">await</span> <span class="pl-s1">win</span><span class="pl-kos">.</span><span class="pl-c1">webContents</span><span class="pl-kos">.</span><span class="pl-en">loadURL</span><span class="pl-kos">(</span><span class="pl-s">'https://httpbin.org/basic-auth/user/passwd'</span><span class="pl-kos">)</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span></pre></div>