开发者

Django Piston issue - "oauth_user_auth() takes exactly 1 argument (2 given)"

I am having a few problems setting up Django Piston. I have managed to get as far as generating authentication via the oauth_client.py sample shown here (http://github.com/clemesha/django-piston-oauth-example). When I run "python oauth_client.py" i am taken to http://localhost:8000/api/oauth/authorize/?oauth_token=8wm33jeWR92BpsrHjs where I then tick a box to confirm access and then submit the form.

At this point i hit a "oauth_user_auth() takes exactly 1 argument (2 given)" error. Simple answer, i'm sure, is that the oauth_user_auth method doesnt accept one parameter, but to remove that character i would have to edit a piston file, which i'm a little开发者_开发技巧 reticent to do so. Has anyone else come across this issue before?


This problem comes from the fact that your OAuth consumer does not specify any callback URL. Your call should look like this: http://localhost:8000/api/oauth/authorize/?oauth_token=8wm33jeWR92BpsrHjs&oauth_callback=http://www.myoauthconsumer.com/receive_authorization/

http://www.myoauthconsumer.com/receive_authorization/ should request an access token if authorization has been granted by the service provider... This diagram at oauth.net is very helpful for understanding the workflow of the oauth protocol.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜