NTLM Authentication Failed,服务器最终响应“401",而不是“200 OK" [英] NTLM Authentication Failed, the server finally response "401", but not "200 OK"

查看:96
本文介绍了NTLM Authentication Failed,服务器最终响应“401",而不是“200 OK"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Node.js 通过 NTLM 身份验证连接到服务器.作为 NTLM 协议步骤如下(参考:http://www.innovation.ch/personal/罗纳德/ntlm.html).

I'm using Node.js to connect to Server with NTLM Authentication. As the NTLM protocol steps below(refer: http://www.innovation.ch/personal/ronald/ntlm.html).

1: C  --> S   GET ...

2: C <--  S   401 Unauthorized
              WWW-Authenticate: NTLM

3: C  --> S   GET ...
              Authorization: NTLM <base64-encoded type-1-message>

4: C <--  S   401 Unauthorized
              WWW-Authenticate: NTLM <base64-encoded type-2-message>

5: C  --> S   GET ...
              Authorization: NTLM <base64-encoded type-3-message>

6: C <--  S   200 Ok

第 1-5 步工作正常,但在第 6 步中,服务器没有返回 200 OK,而是返回状态码 401 和标题:

the 1-5 step works fine, but in the 6th step, the server didn't return me with 200 OK, but returned me with status code 401, and with headers:

头部:{

   'content-type': 'text/html',
   server: 'Microsoft-IIS/8.0',
   'www-authenticate': 'Negotiate, NTLM',
   'x-powered-by': 'ASP.NET',
   date: 'Sat, 12 Jul 2014 06:44:25 GMT',
   'content-length': '1293' 

}

有什么问题吗?你可以帮帮我吗?为什么它不返回 200 OK 和正确的响应正文?非常感谢

Is there anything wrong? Could you help me? Why doesn't it return 200 OK and correct response body? Thanks very much

推荐答案

all.

我终于找到了答案.我使用这个 ntlm 模块(https://www.npmjs.org/package/ntlm)来做ntlm认证.它不起作用,因为我使用了错误的用户名.我是从调试日志中找到的,你也可以在 adfs 机器的事件视图中找到这个信息(它会有错误信息).我为这个愚蠢的错误感到抱歉,但现在我对 ntlm 了如指掌.谢谢阿里雷扎.谢谢大家:-)

I found the answer finally. I use this ntlm module(https://www.npmjs.org/package/ntlm) to do the ntlm Authentication. And it doesn't work because I use wrong username. I found it from debug log and you can also found this info in the adfs machine's event view(it will have error info). I'm sorry for the stupid mistake, but not bad now I know ntlm well. Thanks Alireza. Thanks all:-)

这篇关于NTLM Authentication Failed,服务器最终响应“401",而不是“200 OK"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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