]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Correct example variable, use consistant quoting
authorGavin M. Roy <gavinmroy@gmail.com>
Mon, 6 Jan 2014 21:55:35 +0000 (16:55 -0500)
committerGavin M. Roy <gavinmroy@gmail.com>
Mon, 6 Jan 2014 21:55:35 +0000 (16:55 -0500)
tornado/auth.py

index b7ab57aea069df65ffef23a5161b676c8e739606..9baac9baf8d54d4b70858bb6943c400bc7d7b06d 100644 (file)
@@ -958,21 +958,22 @@ class GoogleOAuth2Mixin(OAuth2Mixin):
 
         Example usage::
 
-            class GoogleOAuth2LoginHandler(LoginHandler, tornado.auth.GoogleOAuth2Mixin):
+            class GoogleOAuth2LoginHandler(LoginHandler,
+                                           tornado.auth.GoogleOAuth2Mixin):
                 @tornado.gen.coroutine
                 def get(self):
-                    if self.get_argument("code", False):
+                    if self.get_argument('code', False):
                         user = yield self.get_authenticated_user(
                             redirect_uri='http://your.site.com/auth/google',
-                            code=self.get_argument("code"))
+                            code=self.get_argument('code'))
                         # Save the user with e.g. set_secure_cookie
                     else:
                         yield self.authorize_redirect(
                             redirect_uri='http://your.site.com/auth/google',
-                            client_id=self.settings["google_consumer_key"],
-                            scope=['openid', 'email'],
+                            client_id=self.settings['google_oauth']['key'],
+                            scope=['profile', 'email'],
                             response_type='code',
-                            extra_params={"approval_prompt": "auto"})
+                            extra_params={'approval_prompt': 'auto'})
         """
         http = self.get_auth_http_client()
         body = urllib_parse.urlencode({