Added support for logging in and storing authentication method in the config