Added support for changing the auth mechanism.