Refactored to better support custom auth parameters