Twitter API 不尊重我的callback_url 参数
我已经阅读了 SO 和其他地方有关类似问题的所有线程,但没有一个能解决我的问题。
我使用 Twython 作为 API 的包装器。我尝试过在任何地方设置 oauth_callback 。使用Tython中的内部机制(通过在实例化时设置callback_url来完成),通过手动修改auth_url并在重定向用户之前附加参数等。我尝试删除并重新创建新的twitter应用程序和新的twitter帐户,无济于事。
每当我将客户端重定向到 twitter 时,正确的 oauth_callback 始终在 url 中与 oauth_token 一起可见,但 api 总是忽略此参数并使用我的 twitter 应用程序设置中的 url 覆盖它(两者都在同一域下) 。我已经尝试解决这个问题几个小时了,但我陷入了死胡同。我以前见过这项工作并且已经做过很多次了,所以我不知道可能出了什么问题。
这很奇怪——即使我将回调设置为“oob”(这应该触发 PIN 工作流程而不是回调),这个参数甚至会被忽略。有什么想法吗?
I've read all the threads about simiular issues on SO and elsewhere, and none of them have solved my problem.
I'm using Twython as a wrapper around the API. I've tried setting oauth_callback EVERYWHERE. Using the internal mechanism in Tython (which is done by setting callback_url on instantiation), by manually modifying the auth_url and appending the argument by before redirecting the user, etc. I've tried deleting and recreating both new twitter apps and new twitter accounts, to no avail.
Whenever I redirect the client to twitter, the correct oauth_callback is ALWAYS visible in the url along with the oauth_token, but the api always ignores this argument and overrides it with the url in the settings of my twitter app (both are under the same domain). I have tried figuring this out for several hours and I'm at a dead end. I've seen this work before and I've done it plenty of times, so I don't know what could possible be going wrong.
It's strange-- even if i set the callback to 'oob', which ought to trigger the PIN workflow rather than a callback, this argument is EVEN THEN ignored. Any ideas why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您获取 OAuth 1.0a 中指定的请求令牌时,您可以指定
oauth_callback
值。在 1.0 中,您可以在用户访问 twitter.com 时将其与用户一起传递,但出于安全原因进行了更改。您可以在 /oauth/request_token 文档 中了解更多相关信息。You specify the
oauth_callback
value when you get a request token as specified in OAuth 1.0a. In 1.0 it you could pass it along with with the user when they go to twitter.com but was changed for security reasons. You can read more about it in the /oauth/request_token docs.