我正在尝试将node-sspi集成到我的api中。我不断收到错误消息
401未经授权
使用以下代码:
winAuth = function (req, res, next) {
var nodeSSPI = require('node-sspi')
var nodeSSPIObj = new nodeSSPI({
retrieveGroups: false,
})
nodeSSPIObj.authenticate(req, res, function (err) {
res.finished || next()
})
}
// login endpoint for authenticating with the app
router.post('/login', winAuth, function (req, res, next) {
console.log(req.connection.user)
}
我将代码从“ https://www.npmjs.com/package/node-sspi”复制到另一个小js文件中,并使用“ node sspi-test.js”运行,它运行良好,因此我知道该程序包使用默认代码正常运行我可以拉出我的电脑广告名称,但是当我将其集成到api中时,会遇到各种各样的问题。
node-sspi软件包上是否还有其他/更好的文档?