# Do Browser Bots support HTTP Basic or NTLM authentication?

> How to supply HTTP Basic or NTLM authentication credentials to Loadster Browser Bots when load testing a site that requires them.

Source: https://loadster.com/faqs/set-http-basic-or-ntlm-authentication-for-browser-bots/

Yes, Browser Bots can authenticate with HTTP Basic Authentication or NTLM, with some caveats.

To supply HTTP authentication credentials in your browser script, simply create a
[code block](https://loadster.com/manual/code-blocks/) at the beginning of the script with a single line like this.

```javascript
browser.setHttpAuthentication("myUsername", "myPassword");
```


You could also pull dynamic values from a [dataset](https://loadster.com/manual/dynamic-datasets/). This example assumes
your dataset has two columns, with the username in the first column and the password in the second, and it is bound to
a variable called `auth`.

```javascript
const username = bot.getVariable("auth", 0);
const password = bot.getVariable("auth", 1);

browser.setHttpAuthentication(username, password);
```


Each Browser Bot can only set HTTP authentication credentials once, typically at the beginning of the script. After you
set them, the Browser Bot will automatically pass them to any site that requires them. Take care not to leak your
credentials to an untrusted 3rd party site if you are browsing multiple sites in the same script.

Unfortunately it's not possible at this time to change the credentials later in the script, or use a different set of
credentials for each domain, due to limitations in our browser automation libraries.

> HTTP Basic and NTLM credentials are handled at the HTTP/S protocol layer. They are different from the more common
> web form authentication forms used on most sites today (the kind that uses cookies or local storage or
> similar). If your application has a web-based login form, chances are you can automate it using ordinary
> [type](https://loadster.com/manual/browser-scripts/#type) and [click](https://loadster.com/manual/browser-scripts/#click)
> steps instead of relying on HTTP Basic or NTLM authentication.

