首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >NTLM如何为webservice对用户进行身份验证?

NTLM如何为webservice对用户进行身份验证?
EN

Stack Overflow用户
提问于 2014-11-17 08:17:42
回答 3查看 8.6K关注 0票数 6

为了更好地理解ntlm,比如http://www.innovation.ch/personal/ronald/ntlm.html,我浏览了一些网站。我开始创建一个演示,它使用ntlm对nodejs应用程序中的用户进行身份验证。在这个演示中,我使用、高速公路、快递-ntlm模块创建了应用程序。但我仍然不明白,ntlm是如何与nodejs with服务协同工作的?

我脑子里有一些关于ntlm认证的问题。

  • ntlm是如何为webservice工作的?
  • 如何在使用ntlm时自定义登录页面?目前,我正在获得登录凭据输入框。
  • 我可以使用哪些用户进行身份验证?目前,应用程序接受任何用户名和密码。因此,我不清楚它将使用哪个用户名和密码。

这是我的密码。

代码语言:javascript
复制
var app, express, ntlm;

express = require('express');

ntlm = require('express-ntlm');

app = express();

app.all('/', ntlm());

app.get('/', function(request, response) {
  response.send(request.ntlm);
});

app.listen(3000);
EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2014-11-25 04:31:35

有一个Passport.js身份验证策略,它支持NTLM身份验证,并具有允许自定义登录屏幕的方法。如何配置它将取决于您使用的服务器类型,但它们在解释示例中的概念方面做得很好。

请参阅非集成身份验证一节。

https://www.npmjs.org/package/passport-windowsauth

票数 5
EN

Stack Overflow用户

发布于 2014-11-26 08:55:01

我想你是在找this answer。阅读josh3736的答案,他解释了NTLM的流程。

同样,正如Brian所建议的那样,您真的不需要进入所有这些东西,passport.js可以有效地为您处理这一切。这里是一个教程http://passportjs.org/guide/

票数 2
EN

Stack Overflow用户

发布于 2022-05-10 14:10:47

用于GET请求的NTLM进程:

代码语言:javascript
复制
 STEP 1: The Client requests a protected resource from the server
 STEP 2: The Server responds with a 401 status, with a header indicating that the client must authenticate
 STEP 3: The Client resubmits the request with an Authorization header containing a Base-64 encoded Type 1 message.  From this point forward, the connection is kept open; closing the connection requires reauthentication of subsequent requests.
 STEP 4: The Server replies with a 401 status containing a Base-64 encoded Type 2 message in the WWW-Authenticate header
 STEP 5: The Client responds to the Type 2 message by resubmitting the request with an Authorization header containing a Base-64 encoded Type 3 message
 STEP 6: Finally, the Server validates the responses in the client's Type 3 message and allows access to the resource.

NTLM处理员额请求:

代码语言:javascript
复制
 STEP 1: The Client submit an empty POST request with a Type 1 message in the "Authorization" header
 STEP 2: The Server replies with a 401 status containing a Base-64 encoded Type 2 message in the WWW-Authenticate header
 STEP 3: The Client resubmits the POST with a Base-64 encoded Type 3 message Type 3 message, sending the data payload with the request.
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26968261

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档