JMeter的基本身份验证 [英] JMeter Basic Authentication

查看:4554
本文介绍了JMeter的基本身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图暗示使用JMeter的Web服务的基本身份验证过程。但每次它抛出了一个错误401:未经授权。我尝试使用HTTP头经理页眉授权和值添加到它。它仍然无法正常工作。我已经使用HTTP授权经理也试过。仍然没有运气。有人可以提供帮助。

I am trying to imply the basic authentication process for a web service using JMeter. But everytime it throws out an error 401:Unauthorized. I tried using the HTTP Header manager to add a header Authorization and value to it. Still it does not work. I have also tried using the HTTP Authorization manager. Still no luck. Can someone help.

推荐答案

我已经通过从JMeter的到来,该HTTP授权管理器模块没有带code中的用户名和密码正确调试请求中找到。它把一个换行符的用户名后。

I've found through debugging requests coming in from JMeter that the HTTP Authorization Manager module doesn't encode the username and password correctly. It puts a newline character after the username.

要运行针对基本验证一个JMeter测试保护端点,包括HTTP头管理,并添加基本认证头一下:

To run a JMeter test against a Basic Auth protected endpoint, include the HTTP Header Manager and add the Basic Auth header yourself:


  • 从的MacOS或Linux:

  • From MacOS or Linux:

回声-n用户名:密码| BASE64

在Windows中:

和连接code你的用户名:密码href=\"http://www.base64de$c$c.org\">字符串

Go here and encode your "username:password" string

在HTTP头管理,名称为授权和值添加一个条目基本[CN从上面codeD凭据]

In the HTTP Header Manager, add an entry with the name "Authorization" and the value "Basic [encoded credentials from above]"

这篇关于JMeter的基本身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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