public class DslAuthManager extends BaseConfigElement
This is a handy way of specifying HTTP authentication without having to worry about particular requests or HTTP header handling.
When specifying multiple authentications, consider that the first matching authentication will be applied. So, if you have two urls with different authentication which one is contained by the other, define the longest one first and then the shorter one to get expected behavior. E.g:
httpAuth()
.basicAuth("http://myservice/user", "user1", "pass1")
.basicAuth("http://myservice", "user2", "pass2")
| Modifier and Type | Class and Description |
|---|---|
static class |
DslAuthManager.CodeBuilder |
guiClass, name| Constructor and Description |
|---|
DslAuthManager() |
| Modifier and Type | Method and Description |
|---|---|
DslAuthManager |
basicAuth(String baseUrl,
String user,
String password)
Specifies authentication credentials to use with HTTP Basic authentication for a given base
url.
|
protected org.apache.jmeter.testelement.TestElement |
buildTestElement() |
buildConfiguredTestElement, buildTestElementGui, buildTreeUnder, configureTestElement, durationToSeconds, loadBeanProperties, showAndWaitFrameWith, showFrameWith, showInGui, showTestElementGuiclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuildTreeUnder, showInGuipublic DslAuthManager basicAuth(String baseUrl, String user, String password)
baseUrl - allows filtering requests to which HTTP Basic authentication should be sent.
All requests with a URL starting with this given base url will include Basic
authentication.
Even though you can use empty string to match any URL and simplify configuration, this is not advised since it may lead to sending the authentication credentials to an unexpected URL and cause a security leak.
user - specifies the username for the basic authentication.password - specifies the password for the basic authentication.protected org.apache.jmeter.testelement.TestElement buildTestElement()
buildTestElement in class BaseTestElementCopyright © 2024. All rights reserved.