【问题标题】:Secure Webservice (NTLM) - Jmeter安全 Web 服务 (NTLM) - Jmeter
【发布时间】:2010-06-28 06:15:52
【问题描述】:

我正在尝试使用 Jmeter 测试 Web 服务。 Web 服务受 NTLM 身份验证(Windows)的保护。我可以使用WebService(SOAP) Request 采样器加载 WSDL。 目前,它仅在我将代理服务器与此 SO answer 中提到的 BurpSuit 一起使用时才有效(而不是 SOUP UI,我将 Jmeter 与 BurpSuite 一起使用)。

但我不想使用代理服务器,而是直接在 Jmeter 中使用带有 NTLM 身份验证的 Web 服务。我已经尝试过 HTTP Authentication Manager 和 ntlm 身份验证。但它仍然在回复中给出401 Authorization Required

感谢您的帮助。

采样器结果。

Thread Name: WebSVC 1-1
Sample Start: 2010-06-28 13:54:08 IST
Load time: 752
Latency: 0
Size in bytes: 401
Sample Count: 1
Error Count: 0
Response code: 200
Response message: OK

Response headers:
Date=Mon, 28 Jun 2010 08:24:08 GMT
Server=Apache/2.2.9 (Unix) DAV/2 mod_jk/1.2.26
Connection=close
WWW-Authenticate=NTLM


SampleResult fields:
ContentType: text/html; charset=iso-8859-1
DataEncoding: iso-8859-1

和回应

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>401 Authorization Required</title>
</head><body>
<h1>Authorization Required</h1>
<p>This server could not verify that you
are authorized to access the document
requested.  Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.</p>
</body></html>

【问题讨论】:

    标签: authentication web-services ntlm jmeter


    【解决方案1】:

    我设法使用SOAP/XML-RPC Request Sampler 并启用Use keepAlive 选项使其工作(当然在HTTP Authentication Manager 的帮助下。

    【讨论】:

    • 你有什么想法,为什么相同配置的 HTTP Authentication Manager 不适用于 WebService(SOAP) Request sampler?我尝试搜索 jmeter bugzilla 和邮件列表,但没有成功。
    • 使用嗅探器后,我发现 WebService(SOAP) 请求和 SOAP/XML-RPC 请求都首先尝试使用基本方法进行身份验证。收到 401 WebService(SOAP) Request sampler 后停止执行,而 SOAP/XML-RPC Request sampler 继续进行摘要认证,成功
    【解决方案2】:

    您可以将安全参数添加到标题中。

     <soapenv:Header>  <wsse:Security soapenv:mustUnderstand="1" 
    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> 
             <wsse:UsernameToken> 
                <wsse:Username>USERNAME_PARAM</wsse:Username> 
                <wsse:Password 
    Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">PASSWORD_PARAM</wsse:Password> 
             </wsse:UsernameToken> 
          </wsse:Security> 
    

    【讨论】:

    • 这不起作用 - 在 HTTP 层上执行身份验证。即使我写的是“圣诞快乐”而不是有效的肥皂 XML,也会得到响应 401。
    【解决方案3】:

    在 HTTP 授权管理器中,您是否为“基本 URL”字段提供值?
    如果是这样,它的形式是:https://${soap_domain}(注意安全的 http)。

    授权失败问题困扰了我一段时间,但发现一个快速的解决方法是将基本 url 字段留空并仅提供用户名和密码。

    【讨论】:

    • 感谢您的回答@BlackGaff,我已经通过使用另一个采样器解决了这个问题。请看下面我的回答
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-30
    • 2020-11-29
    • 2014-07-02
    • 1970-01-01
    相关资源
    最近更新 更多