This authentication codes is pretty much copied from the
keystoneclient, but greatly simplified. The tests in
keystoneclient were hard to bring over without a lot of
other baggage, so the tests were created from scratch.
Change-Id: I1033c7f64ac47bf461679d5ffa8847a1acf7c59e