JMeter Basic Authentication Explained
You're often confronted with web application which requires user to authenticate. Basic Access Authentication is one of the most simple authentication method:
- Client includes an HTTP Header like
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
, with Base64 encoded username and password (username:password
equalsdXNlcm5hbWU6cGFzc3dvcmQ=
inBase64
) in each request, - Server grants access whenever the provided username and password are correct.
This guide will teach you 3 different ways to handle basic authentication:
- Using an HTTP Authorization Manager,
- Using a JSR223 PreProcessor with a custom script,
- Or using the
base64Encode
function from Custom Functions Plugin.
Let's see dive into JMeter with examples you can use yourself!