learning from https://github.com/livingsocial/rails-googleapps-auth