You can use HTTP Basic Authentication with Javascript/Ajax in just three steps. I’ll give you them in just a moment. The Background This morning, I was experimenting with Adobe AIR, writing a client to tell me whether I have games waiting for me to make a move on Weewar, and I needed to be able to use my username and “token” via Basic Auth to do that. It was not easy to find how to do it. In fact,
![How to do HTTP Basic Auth in Ajax - CodersEye.com](https://cdn-ak-scissors.b.st-hatena.com/image/square/c9af1c5c2c01c72f3c994c0559c2ea3b8ac1f1e0/height=288;version=1;width=512/https%3A%2F%2Fcoderseye.com%2Fwp-content%2Fuploads%2FHow-to-do-HTTP-Basic-Auth-in-Ajax.jpg)