Node.js NTLM HTTP验证,如何处理3种类型 [英] Node.js NTLM HTTP Authentication, how to handle the the 3 types

查看:187
本文介绍了Node.js NTLM HTTP验证,如何处理3种类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,对不起,如果这是一个愚蠢的问题,但我试图让NTLM身份验证工作与Node.js.我一直在阅读( http://davenport.sourceforge.net/ntlm.html#theNtlmMessageHeaderLayout )。我发送标题并获得Base64认证头。

Alright, sorry if this is a stupid question, but I'm trying to get NTLM Authentication working w/ Node.js. I've been reading this ( http://davenport.sourceforge.net/ntlm.html#theNtlmMessageHeaderLayout ). I send the header and get a Base64 authentication header.

我尝试通过使用base64编码的新缓冲区将其从Base64转换为UTF8,然后调用 toString('utf8')返回一个字符串,如

I tried converting it from Base64 to UTF8 by making a new Buffer with base64 encoding and then calling toString('utf8') which returns a string something like

NTLMSSP\\\\\\\ u0000\\\\\\\\\�\b�\\\

这是我需要帮助的地方。我明白NTLMSSP\\\是空终止的签名,但是其余的是应该是/ em>来表示,但对我来说这只是垃圾。它是unicode字符,但我应该如何获得实际的数据?我可能会错误地转换,这可能会增加我的烦恼,但我希望有人能够帮助。

This is where I need help. I understand the NTLMSSP\u0000 is the null terminated signature, but and what the rest is supposed to indicate, but to me it's just garbage. It's unicode characters, but how am I supposed to get actual data out of that? I may be converting it incorrectly, which may be adding to my troubles, but I'm hoping someone can help.

推荐答案

有看看 http://www.innovation.ch/personal/ronald/ntlm.html
你收到的是一个Type-2消息。这些页面以非常实用的方式解释。您必须提取服务器挑战(nonce)和服务器标志。

Have a look at http://www.innovation.ch/personal/ronald/ntlm.html What you receive is a Type-2 Message. The pages explains it in a very practical way. You have to extract the server challenge (nonce) and the server flags.

我刚刚为node.js实现了一个模块: https://github.com/SamDecrock/node-http-ntlm

I just implemented a module for node.js to do just that: https://github.com/SamDecrock/node-http-ntlm

这篇关于Node.js NTLM HTTP验证,如何处理3种类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆