Basic authentication is a method for gaining access to a system by way of Base64 encoding using the username and password credentials before sending them over HTTP. For example, given the username 'Aladdin' and password 'open sesame', the string 'Aladdin:open sesame' is Base64 encoded, resulting in 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='. This Base64 string is then decoded by the receiving server, resulting in the original username-password string separated by a colon. While this is not the most secure of authentication schemes, it is unreadable to the human eye, and for small APIs or private systems it is very easily implemented. All web browsers from the HTTP/1.1 support basic authentication, so it can be widely implemented across both the Web and mobile devices without being concerned about browser support.
Many external services use basic authentication and session keys in order for you to access and interact with their APIs. In this example, I...