dheerajrajjak / google-api-python-client

Automatically exported from code.google.com/p/google-api-python-client
0 stars 0 forks source link

expose OAuth2WebServerFlow's kwargs arg to appengine.OAuth2Decorator #82

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I wanted to use the decorator like this:
decorator = OAuth2Decorator(
    client_id='xxx',
    client_secret='xxx',
    scope='https://www.googleapis.com/auth/latitude.current.best',
    access_type='offline',
    approval_prompt='force'
)

The below patch allows the extra args (access_type and approval_prompt) to be 
passed to OAuth2WebServerFlow

$ hg diff
diff -r ce0ec2c89f3d oauth2client/appengine.py
--- a/oauth2client/appengine.py Thu Jan 05 10:48:24 2012 -0500
+++ b/oauth2client/appengine.py Thu Jan 05 21:57:53 2012 -0800
@@ -308,7 +308,7 @@
   def __init__(self, client_id, client_secret, scope,
                auth_uri='https://accounts.google.com/o/oauth2/auth',
                token_uri='https://accounts.google.com/o/oauth2/token',
-               message=None):
+               message=None,**kwargs):

     """Constructor for OAuth2Decorator

@@ -326,7 +326,7 @@
         web interface for any method that uses the decorator.
     """
     self.flow = OAuth2WebServerFlow(client_id, client_secret, scope, None,
-        auth_uri, token_uri)
+        auth_uri, token_uri, **kwargs)
     self.credentials = None
     self._request_handler = None
     self._message = message

Original issue reported on code.google.com by jaybuffi...@gmail.com on 6 Jan 2012 at 6:01

GoogleCodeExporter commented 8 years ago
Good idea! Currently out for review http://codereview.appspot.com/5522049/

Original comment by jcgregorio@google.com on 6 Jan 2012 at 3:05

GoogleCodeExporter commented 8 years ago
Fixed in 
http://code.google.com/p/google-api-python-client/source/detail?r=3c049968772266
7545831af622b89601e65f8cd5

Original comment by jcgregorio@google.com on 6 Jan 2012 at 5:31