Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
712 views
in Technique[技术] by (71.8m points)

ruby on rails - OAuth::Problem (parameter_absent)

Im working with OAuth 0.3.6 and the linkedin gem for a Rails application and I have this issue where OAuth throws an error saying that OAuth::Problem (parameter_absent). The thing is it doesn't throw the error on every occasion its called and the problem is I am unable to reproduce the issue locally to test it.

The documentation says that :

[parameter_absent: a required parameter wasn't received. In this case, the response SHOULD also contain an oauth_parameters_absent parameter. ]

but the request is generated the same way each time to obtain the tokens so I fail to understand why this happens.

Log

OAuth::Problem (parameter_absent):
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 `authorize_from_request'
app/controllers/users_controller.rb:413:in `linkedin_save'

I have seen a few people facing this issue but I am yet to figure out a way to resolve this. Would appreciate some help on this.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The parameter_absent error means that you are not sending all of the required OAuth parameters to the endpoint. For the request token endpoint you need to insure that all of these parameters are present:

  • oauth_consumer_key
  • oauth_signature_method
  • oauth_signature
  • oauth_timestamp
  • oauth_nonce

For the accessToken endpoint the following parameters are required:

  • oauth_consumer_key
  • oauth_signature
  • oauth_signature_method
  • oauth_token
  • oauth_timestamp
  • oauth_verifier

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...