kulpa / google-api-python-client

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

Create OAuth decorator for Django apps #99

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In the same vein as the one for App Engine.

Original issue reported on code.google.com by jcgregorio@google.com on 6 Feb 2012 at 8:57

GoogleCodeExporter commented 9 years ago
As part of this issue, it would be very helpful to abstract the internals of 
oauth2client.appengine. We use a custom framework on App Engine (not Django or 
webapp2), so it's been nearly impossible to reuse oauth2client.appengine since 
the decorator contains most all of the business logic and is coupled to 
webapp's RequestHandler.

I imagine this as just a low-level interface to the actual business logic, with 
lightweight wrappers on top for webapp2, Django, and any other framework. 
Something like an OAuth2Manager class, with a require_authorization() method, 
an is_authorized() method, and a handle_callback(params) method. This would 
then raise generic exceptions, like OAuth2RedirectNeeded, which would signal 
the wrapper classes to implement their framework-specific redirects.

Original comment by fotina...@google.com on 28 Feb 2013 at 1:07