Added more logic to handle all different auth options

Fixes #13