Electron窗口可以使用Windows身份验证登录到SSO吗?

yh2wf1be  于 8个月前  发布在  Electron
关注(0)|答案(1)|浏览(136)

我有一个非常早期的电子应用程序,我们正在使用的概念证明。我在我的文件中使用mainWindow.loadURL('https://example.com');打开窗口,我们的内部应用程序。
我面临的问题是,这个网站使用SSO进行身份验证。
在Chrome / IE浏览器中,SSO在使用Windows身份验证时自动发生。
是否有可能告诉正在创建的电子浏览器窗口也使用此身份验证?

mainWindow = new BrowserWindow({
        width: winState.width,
        height: winState.height,
        minWidth: 992,
        minHeight: 500,
        x: winState.x,
        y: winState.y
    });

    // Set our menu
    setMenu();

    // Load main window that uses SSO
    // When using Chrome or IE, windows authentication passes this without needing to prompt for the credentials.
    mainWindow.loadURL('https://example.com');

字符串

daolsyd0

daolsyd01#

您可以使用session.allowNTLMCredentialsForDomains('example.com')这将允许BrowserWindow发送给定域的NTLM凭据。它还支持使用 * 的通配符,请在此处了解更多信息:https://electronjs.org/docs/api/session#sesallowntlmcredentialsfordomainsdomains

// add this on top
const { session } = require('electron');
session.defaultSession.allowNTLMCredentialsForDomains('example.com')

// your code here  
...

字符串

相关问题