{"id":509,"date":"2015-07-20T10:09:57","date_gmt":"2015-07-20T10:09:57","guid":{"rendered":"https:\/\/loadfocus.com\/blog\/?p=509"},"modified":"2023-06-22T21:09:38","modified_gmt":"2023-06-22T21:09:38","slug":"how-to-create-load-tests-for-urls-that-use-http-basic-authentication-basic-auth","status":"publish","type":"post","link":"https:\/\/loadfocus.com\/blog\/2015\/07\/how-to-create-load-tests-for-urls-that-use-http-basic-authentication-basic-auth","title":{"rendered":"How to Create Load Tests for URLs that use HTTP Basic Authentication (Basic Auth)"},"content":{"rendered":"<span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\"><\/span> <span class=\"rt-time\"> &lt; 1<\/span> <span class=\"rt-label rt-postfix\">minute read<\/span><\/span><p class=\"lead\"><!-- pn-tldr --><\/p>\n<h2>Key takeaways<\/h2>\n<ul>\n<li>Basic Auth sends base64-encoded credentials in a header, so the load test just needs that header set.<\/li>\n<li>Use test credentials, never production ones, since headers end up in logs and reports.<\/li>\n<li>Confirm the endpoint returns 200 rather than 401 before starting the real run.<\/li>\n<\/ul>\n<p><!-- \/pn-tldr -->In order to create load tests for URLs that use HTTP Basic Authentication to give access to resources, we present below the steps needed for creating a simple load test using Basic Auth:<\/p>\n<ol>\n<li>Create a new load test in the Load Focus platform<\/li>\n<li>For creating a Basic Auth test click on the\u00a0Basic Authentication<\/li>\n<li>Enter Username and Password<\/li>\n<li>Once this is done we are ready to run the test by clicking Execute Test<\/li>\n<\/ol>\n<p>The results for the load test can be analysed in the test result page<\/p>\n<p><a href=\"https:\/\/loadfocus.com\">LoadFocus<\/a> is an easy to use cloud testing platform for <a href=\"https:\/\/loadfocus.com\/load-testing\">load testing<\/a>, <a href=\"https:\/\/loadfocus.com\/api-monitoring\">API monitoring<\/a>, <a href=\"https:\/\/loadfocus.com\/page-speed-monitoring\">website speed testing<\/a>.<!-- pn-faq --><\/p>\n<h2>Frequently Asked Questions<\/h2>\n<h3>How does Basic Auth work in a load test?<\/h3>\n<p>The credentials are base64 encoded and sent in an Authorization header, so the test only needs that header set on the requests that require it.<\/p>\n<h3>Can I use real credentials?<\/h3>\n<p>Use test accounts. Headers end up in logs, exports and shared reports, and base64 is encoding rather than encryption, so anyone with the report has the password.<\/p>\n<h3>What should I check before the full run?<\/h3>\n<p>That the endpoint returns 200 rather than 401. A misconfigured header produces a fast, clean-looking test that measured nothing but rejections.<\/p>\n<p><!-- \/pn-faq --><!-- pn-related-reading --><\/p>\n<h2>Related reading<\/h2>\n<ul>\n<li><a href=\"https:\/\/loadfocus.com\/blog\/2016\/04\/how-to-use-apache-jmeter-to-load-test-a-web-server\">How To Use Apache JMeter To Load Test a Web Server<\/a><\/li>\n<li><a href=\"https:\/\/loadfocus.com\/blog\/2026\/07\/data-driven-load-testing-scripts-complex-user-journeys\">Data-Driven Load Testing for Complex User Journeys<\/a><\/li>\n<li><a href=\"https:\/\/loadfocus.com\/blog\/2013\/07\/apache-jmeter-performance-test-introduction\">Introduction to Apache JMeter Performance Testing<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"span-reading-time rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\"><\/span> <span class=\"rt-time\"> &lt; 1<\/span> <span class=\"rt-label rt-postfix\">minute read<\/span><\/span>Key takeaways Basic Auth sends base64-encoded credentials in a header, so the load test just needs that header set. Use test credentials, never production ones, since headers end up in logs and reports. Confirm the endpoint returns 200 rather than 401 before starting the real run. In order to create load tests for URLs that&#8230;  <a href=\"https:\/\/loadfocus.com\/blog\/2015\/07\/how-to-create-load-tests-for-urls-that-use-http-basic-authentication-basic-auth\" class=\"more-link\" title=\"Read How to Create Load Tests for URLs that use HTTP Basic Authentication (Basic Auth)\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":3685,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[84,85],"class_list":["post-509","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-load-testing","tag-http-basic-auth","tag-load-test"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/posts\/509","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/comments?post=509"}],"version-history":[{"count":2,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/posts\/509\/revisions"}],"predecessor-version":[{"id":2634,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/posts\/509\/revisions\/2634"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/media\/3685"}],"wp:attachment":[{"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/media?parent=509"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/categories?post=509"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/loadfocus.com\/blog\/wp-json\/wp\/v2\/tags?post=509"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}