Hotfix for failing on username/password auth.

I jumped the gun a little with removing base64 string encoding, this will fix auth and I've added some unit tests.

Passing on 2.78 and 3.41