Code to accompany article HTTP Basic Auth Explained