Django Piston问题 - “oauth_user_auth()只需1个参数(2个给定)”

时间:2010-07-26 21:00:47

标签: django django-piston django-authentication

我在设置Django Piston时遇到了一些问题。我已经设法通过此处显示的oauth_client.py示例(http://github.com/clemesha/django-piston-oauth-example)来生成身份验证。当我运行“python oauth_client.py”时,我将被带到http://localhost:8000/api/oauth/authorize/?oauth_token=8wm33jeWR92BpsrHjs,然后在其中勾选一个框以确认访问权限,然后提交表单。

此时我点击“oauth_user_auth()正好接受1个参数(2个给定)”错误。简单的答案,我敢肯定,oauth_user_auth方法不接受一个参数,但要删除该字符,我将不得不编辑一个活塞文件,我有点保持沉默。有没有其他人遇到过这个问题?

1 个答案:

答案 0 :(得分:1)

此问题来自于您的OAuth使用者未指定任何回调网址。你的电话应该是这样的: http://localhost:8000/api/oauth/authorize/?oauth_token=8wm33jeWR92BpsrHjs&oauth_callback=http://www.myoauthconsumer.com/receive_authorization/

如果服务提供商授予了授权,

http://www.myoauthconsumer.com/receive_authorization/应该请求访问令牌... oauth.net上的This diagram非常有助于理解oauth协议的工作流程。