The GSpread authorize() method is "left as an exercise for the student".  This shows how to get it going.