Correct auth handling in version 4 (fixes GH-871)