开发者

RoR linkedin gem & OAuth::Problem (signature_invalid)

开发者 https://www.devze.com 2023-02-07 18:03 出处:网络
I am using Ruby 1.8.7, Rails 2.3.8, Linkdin 0.1.7, Roxml 3.1.5 and Oauth 0.3.6. In my accounts controller I am testing the code by Will Read (http://pivotallabs.com/users/will/blog/articles/1096-linke

I am using Ruby 1.8.7, Rails 2.3.8, Linkdin 0.1.7, Roxml 3.1.5 and Oauth 0.3.6. In my accounts controller I am testing the code by Will Read (http://pivotallabs.com/users/will/blog/articles/1096-linkedin-gem-for-a-web-app). When I click "Ok I'll Allow it" button on linkdin, it lands on callback method and then crashes on this line:

atoken, asecret = client.authorize_from_request(session[:rtoken], session[:rsecret], pin)

with the following error trace:

OAuth::Problem (signature_invalid):

oauth (0.3.6) lib/oauth/consumer.rb:167:in `request'

oauth (0.3.6) lib/oauth/consumer.rb:183:in `token_request'

oauth (0.3.6) lib/oauth/tokens/request_token.rb:18:in `get_access_token'

linkedin (0.1.7) lib/linked_in/client.rb:35:in `author开发者_如何学Pythonize_from_request'

app/controllers/accounts_controller.rb:52:in `callback'

.....

Moreover, I checked the values of session for rtoken and rsecret and params[:oauth_verifier], and none of them was blank!


I had a similar issue. In my case the problem was that my consumer sent the request to an HTTP Uri. But the OAuth Server (Stash) had a redirect to httpS. As soon I changed the site url to HTTPS it worked for me.

Another reason can be that there is an Proxy in between. That needs some extra configuration.

0

精彩评论

暂无评论...
验证码 换一张
取 消