通过 npm 查看所有 ntlm/kerberos 模 block ,在针对经过 Windows 身份验证的端点执行 HTTP 请求时,似乎需要硬编码的用户名和密码。
是否可以使用当前登录用户的凭据?
例如在 PowerShell 中,我可以这样做:
$wc = new-object System.Net.WebClient
$wc.UseDefaultCredentials = $true
这对 Node 有可能吗?
最佳答案
使用 node-expose-sspi 可以实现 NTLM 和 Kerberos 身份验证。
https://github.com/jlguenego/node-expose-sspi
注意:我是 node-expose-sspi 的作者。
关于具有自动 ntlm/kerberos 身份验证的 node.js HTTP 请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23495628/