OAuth2 client that works on App Engine

2019-03-14 01:42发布

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.

3条回答
够拽才男人
2楼-- · 2019-03-14 02:26

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

查看更多
放我归山
3楼-- · 2019-03-14 02:35

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
查看更多
太酷不给撩
4楼-- · 2019-03-14 02:45
登录 后发表回答