HTTP basic auth

HTTP basic auth works by taking the username and password, combining them with a colon separator, and encoding them using base64. The username and password can commonly be passed as part of the URL, for example: http://<username>:<password>@www.example.com. Under the hood, what happens though is that the username and password are combined, encoded, and passed as an HTTP header.

If you use this method of authentication, keep in mind that it is not encrypted. There is no protection for the username and password in transit. You always want to use encryption on the transport layer, which means adding TLS/SSL.

HTTP basic auth is not widely used these days, but it is easy to implement. A more common approach is to build or use your ...

Get Security with Go now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.