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

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

问题描述

好吧,对不起,如果这是一个愚蠢的问题,但我试图让NTLM验证工作瓦特/ Node.js的我一直在阅读这(<一个href=\"http://davenport.sourceforge.net/ntlm.html#theNtlmMessageHeaderLayout\">http://davenport.sourceforge.net/ntlm.html#theNtlmMessageHeaderLayout )。我送了头,并得到一个Base64身份验证头。

我试图通过一个新的缓冲带base64编码,然后调用的toString('UTF8')它返回一个字符串像

NTLMSSP \\ u0000的\\ U0001 \\ u0000的符\\ u0000 \\ u0000的\�\\b�\\ u0000的

这是我需要帮助。据我所知,NTLMSSP \\ u0000的是空终止签名,但剩下的是什么的应该的指示,但对我来说它只是垃圾。这是UNI code字符,但我怎么得到实际的数据出来了吗?我可能会错误地将其转换,这可能会增加我的烦恼,但我希望有人可以提供帮助。


解决方案

看一看 http://www.innovation.ch/personal/ronald/ntlm.html
您收到什么是2型的消息。网页解释了它在一个非常实用的方法。你必须提取服务器挑战(随机数)和服务器标志。

我只是实现了一个模块的node.js能够做到这一点: https://开头github上。 COM / SamDecrock /节点HTTP的NTLM

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.

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\u0001\u0000\u0000\u0000\u0007�\b�\u0000

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.

解决方案

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.

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天全站免登陆