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

发布于 2024-09-11 07:57:11 字数 605 浏览 2 评论 0原文

我在设置 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 方法不接受一个参数,但要删除该字符,我必须编辑一个活塞文件,我对此有点犹豫。以前有其他人遇到过这个问题吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

白首有我共你 2024-09-18 07:57:11

此问题源于您的 OAuth 使用者未指定任何回调 URL。您的调用应如下所示:
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 上的这张图对于理解oauth协议的工作流程非常有帮助。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文