javax.security.auth.login.LoginException:未为JMeter配置LoginModules

问题描述 投票:0回答:1

我正在使用Apache Jmeter作为代理来在需要登录的网站上记录脚本。

录制后验证脚本时。我在JMeter日志中收到此错误。


    2020-06-17 12:57:48,760 WARN o.a.j.p.h.c.KerberosManager: Could not log in user ${AUTH_LOGIN}
javax.security.auth.login.LoginException: No LoginModules configured for JMeter
    at javax.security.auth.login.LoginContext.init(LoginContext.java:264) ~[?:1.8.0_181]
    at javax.security.auth.login.LoginContext.<init>(LoginContext.java:417) ~[?:1.8.0_181]
    at org.apache.jmeter.protocol.http.control.KerberosManager.lambda$getSubjectForUser$0(KerberosManager.java:67) ~[ApacheJMeter_http.jar:5.3]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_181]
    at org.apache.jmeter.protocol.http.control.KerberosManager.getSubjectForUser(KerberosManager.java:82) [ApacheJMeter_http.jar:5.3]
    at org.apache.jmeter.protocol.http.control.AuthManager.getSubjectForUrl(AuthManager.java:298) [ApacheJMeter_http.jar:5.3]
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:918) [ApacheJMeter_http.jar:5.3]
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:641) [ApacheJMeter_http.jar:5.3]
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:66) [ApacheJMeter_http.jar:5.3]
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1281) [ApacheJMeter_http.jar:5.3]
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1270) [ApacheJMeter_http.jar:5.3]
    at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:630) [ApacheJMeter_core.jar:5.3]
    at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:558) [ApacheJMeter_core.jar:5.3]
    at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:489) [ApacheJMeter_core.jar:5.3]
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256) [ApacheJMeter_core.jar:5.3]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]

****我在USER_DEFINED_Variable ****中定义了AUTH_LOGIN和AUTH_PASSWORD ****

非常感谢您的帮助,因为我不确定该如何进行。

performance testing jmeter performance-testing jmeter-5.0
1个回答
0
投票

如果您只需要录制.jmx脚本-可能更容易使用JMeter Chrome Extension,在这种情况下,您不必担心代理和证书。

如果继续对该应用程序进行负载测试,您将再次遇到此问题,这意味着您的应用程序正在使用Kerberos协议对用户进行身份验证,因此您需要:

  1. 添加HTTP Authorization Manager和:

    • 提供您的凭据
    • 提供您的域和领域
    • 选择Kerberos作为“机制”
  2. jaas.confkrb5.conf文件中提供必需的配置(均位于JMeter安装的“ bin”文件夹下)

请参阅Windows Authentication with Apache JMeter文章以获取更多详细信息和示例配置。

您可能也对Java Authentication and Authorization Service文档感兴趣

© www.soinside.com 2019 - 2024. All rights reserved.