电子 - 如何制作证书选择弹出窗口?

问题描述 投票:1回答:1

我试图绕着Electron select-client-certificate。我的目标是弹出像Chrome这样的东西,最终用户可以选择他们应该使用哪个证书登录。

Electron默认选择第一个可用的证书,该证书不适用于他们尝试访问的站点。使用特定名称也不起作用,因为为用户分配了略微不同的证书。

任何指导将不胜感激。谢谢。

electron client-certificates
1个回答
1
投票

您应该能够读取证书列表(这是select-client-certificate的参数之一,然后弹出一个窗口让用户选择一个证书。

        browserWindow.webContents.on("select-client-certificate", (event, url, certificateList, callback) => { 
        event.preventDefault();
        // Go through the certificateList
        // certificateList is just Array<Certificate>
        // Show a popup and render the cert list, let user select one
        callback(userSelectedCert);
    });
© www.soinside.com 2019 - 2024. All rights reserved.