Twitter rejects my Oauth Request using scribe-java with “SSL is required”

≯℡__Kan透↙ 提交于 2019-12-23 02:54:13

问题


When trying to execute service.getRequestToken() from scribe library (Version 1.3.5) for using oauth with twitter api I always get "SSL is required" as response.

I have already checked all my configurations but there is https everywhere.


回答1:


In version 1.3.5 of scribe-java, the method getRequestTokenEndpoint() of TwitterApi uses the non-SSL version of the URL.

In version 1.3.6 this has been fixed. Unfortunetaly, this version has not yet made its way to the downloads section (http://mvnrepository.com/artifact/org.scribe/scribe). So one has to build the current version by himself unless it is available there.




回答2:


try put:

OAuthService service = new ServiceBuilder()
.provider(TwitterApi.SSL.class)
.apiKey("YOUR_API_KEY")
.apiSecret("YOUR_API_SECRET")
.callback("YOUR_CALLBACK")
.build();


来源:https://stackoverflow.com/questions/22763702/twitter-rejects-my-oauth-request-using-scribe-java-with-ssl-is-required

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!