Fix authentication, cherry-picked from upstream.

Commit: https://github.com/jplehmann/coursera/commit/15354ebf6bc31d99d6d8ef82c9420725812cc7dc
Thank you @jonasdt