Make authentication more configurable and extendable.

Signed-off-by: Jason Lewis <jason.lewis1991@gmail.com>
Fix test, don't worry about checking the exceptions message.

Signed-off-by: Jason Lewis <jason.lewis1991@gmail.com>