Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OAuth2 client that works on App Engine

Can anyone advice me on a good library or else how to go about having a Python appengine based application using OAuth to authenticate to another server?

I have an application on appengine that expects user input. I would like the user to be able to upload an image, which I would put in imgur.com and would be able to show to the user back on my page. To be able to do that, I need to be able to authenticate to api.imgur.com hence the question.

like image 712
Muhammad Alkarouri Avatar asked Mar 29 '11 16:03

Muhammad Alkarouri


2 Answers

Have a look to python-oauth2 project.

A Client example:

import oauth2 as oauth

# Create your consumer with the proper key/secret.
consumer = oauth.Consumer(key="your-twitter-consumer-key", 
    secret="your-twitter-consumer-secret")

# Request token URL for Twitter.
request_token_url = "http://twitter.com/oauth/request_token"

# Create our client.
client = oauth.Client(consumer)

# The OAuth Client request works just like httplib2 for the most part.
resp, content = client.request(request_token_url, "GET")
print resp
print content
like image 102
systempuntoout Avatar answered Nov 12 '22 09:11

systempuntoout


I believe the simplegeo oauth2 does not play well with GAE. Mike Knapp's library on GitHub is nice and simple, no install needed.

like image 1
stannie Avatar answered Nov 12 '22 07:11

stannie