twitter响应:“错误32:无法验证您”从Heroku,但不是桌面 [英] twitter response: "error 32: Could not authenticate you" from Heroku, but not desktop
问题描述
我按照Carin Meier的我如何开始帖子的指示,遇到问题发布到从Heroku的twitter(像她的例子)。请注意,我的应用程序没有网络组件,只是一个工作组件。
在我的桌面上测试,我可以发布到twitter和gist.github.com 。
但是,在Heroku,我总是得到线程main中的异常java.lang.Exception:Twitter响应请求错误32:无法验证您。
我是可以发布到gist.github.com,因此它似乎是一个只有Twitter的问题。
我已经使用 heroku run lein repl
来确认我的信誉看起来很好:
(reset!my-twitter-creds(tw-oauth / make-oauth-creds
(env:app-consumer-key)
(env:消费者秘密)
(env:用户访问令牌)
(env:user-access-secret)))
但调用:
(tw / statuses-user-timeline:oauth -creds @ my-twitter-creds
:params {:count 1:screen-namemyname})
b $ b总是给出错误32。
我为此创建的所有代码都可以在这里浏览: https://github.com/rogerallen/tweegeemee/blob/master/src/tweegeemee/core.clj
我目前的怀疑是Heroku需要一个twitter Oauth回调URL。但是,由于我的应用程序没有网络工作者,我不想添加这个(它没有在帖子中提到)。
解决方案根据您的描述,如果您可以使用lein在本地发布到twitter
也许检查
heroku配置
或者甚至在heroku日志中将一些更多的日志记录在手表中,以查看它正在调用什么。I'm following the instructions from Carin Meier's How I Start post and having an issue with posting to twitter (like her example) from Heroku. Note that my app does not have a web component, just a worker component.
Testing on my desktop, I'm able to post to twitter and gist.github.com.
But, on Heroku, I always get
Exception in thread "main" java.lang.Exception: Twitter responded to request with error 32: Could not authenticate you.
I am able to post to gist.github.com, so it appears to be a twitter-only issue.I have used
heroku run lein repl
to confirm that my creds look just fine:(reset! my-twitter-creds (tw-oauth/make-oauth-creds (env :app-consumer-key) (env :app-consumer-secret) (env :user-access-token) (env :user-access-secret)))
but a call to:
(tw/statuses-user-timeline :oauth-creds @my-twitter-creds :params {:count 1 :screen-name "myname"})
Always gives the error 32.
All the code I've created for this is available to browse here: https://github.com/rogerallen/tweegeemee/blob/master/src/tweegeemee/core.clj
My current suspicion is that there is some requirement on Heroku for a twitter Oauth callback URL. But, since my app does not have a web-worker, I don't want to have to add this (and it isn't mentioned in the post).
Can anyone help me get this working?
解决方案From what you described, if you can post to twitter using lein run locally with your environment variables - then the only difference should be the environment variables that heroku is using.
Maybe check with
heroku config
or even put some more logging in an watch in the heroku logs to see what it is calling it with.这篇关于twitter响应:“错误32:无法验证您”从Heroku,但不是桌面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!