The BA mechanism does not provide
confidentiality protection for the transmitted credentials. They are merely encoded with
Base64 in transit and not
encrypted or
hashed in any way. Therefore, basic authentication is typically used in conjunction with
HTTPS to provide confidentiality. Because the BA field has to be sent in the header of each HTTP request, the web browser needs to
cache credentials for a reasonable period of time to avoid constantly prompting the user for their username and password. Caching policy differs between browsers. HTTP does not provide a method for a web server to instruct the client to "log out" the user. However, there are a number of methods to clear cached credentials in certain web browsers. One of them is redirecting the user to a URL on the same domain, using credentials that are intentionally incorrect. However, this behavior is inconsistent between various browsers and browser versions.
Microsoft Internet Explorer offers a dedicated JavaScript method to clear cached credentials: document.execCommand(''); In modern browsers, cached credentials for basic authentication are typically cleared when clearing browsing history. Most browsers allow users to specifically clear only credentials, though the option may be hard to find, and typically clears credentials for all visited sites. Brute forcing credentials is not actively prevented or detected (unless a server-side mechanism is used). == Protocol ==