Backported auth changes (daa205e428ba0022a0b6a6a89c11f61bb8cb0984)

Fix coursera auth changes in mechanize branch too