gpt4 book ai didi

node.js - 如何验证 kerberos token (在 node.js 中)?

转载 作者:搜寻专家 更新时间:2023-11-01 00:02:00 24 4
gpt4 key购买 nike

我不太确定我的描述是否正确。

基本上,我正在尝试添加 Windows Authentication到 node.js 站点。

我发回一个 401WWW-Authenticate: Negotiate标题。

浏览器立即返回 authorization header 值为 Negotiate <some string of characters>

此时,我只想确保 token 有效。我试图找到执行此操作的其他开源框架的示例,但我真的不知道我在寻找什么。

需要说明的是,用户已经登录域并且没有发送用户名/密码信息。

(我可能不完全理解这一切是如何工作的)。

我刚找到 this .

Server decodes the NegTokenInit, extracts the supported MechTypes (the one at the front of the MechTypeList should be either Kerberos Legacy or Kerberos V5), ensures it is one of the expected ones, and then extracts the MechToken and authenticates using gss_accept_security_context.

如果我没理解错的话,我在找gss_accept_security_context .

我也尝试使用 GSSManager在java中没有运气。我发布了那个问题here .

我的方向是否正确?

最佳答案

我最近提交了上述 kerberos 模块的拉取请求 (https://www.npmjs.org/package/kerberos) 以实现服务器端身份验证。以前该模块只实现了客户端 API。

我还创建了一个护照身份验证策略 passport-negotiate ( https://www.npmjs.com/package/passport-negotiate ),它利用它并实现服务器端 HTTP 身份验证,包括 401 和 WWW-Authenticate。

你可以在这里看到它的细节:

https://github.com/dmansfield/passport-negotiate/blob/master/lib/passport-negotiate/strategy.js

不幸的是,除非拉取请求被合并到 kerberos 模块中并且有一个新版本,否则这将无法工作,或者您可以从我的 github 中获取 kerberos 的补丁版本:

https://github.com/dmansfield/kerberos

关于node.js - 如何验证 kerberos token (在 node.js 中)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25276492/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com