我正尝试使用OAuth gem在我的Ruby on Rails应用程序中对Evernote进行身份验证。我正在使用教程来验证Twitter - http://blog.brijeshshah.com/integrate-twitter-oauth-in-your-rails-application/,因为我找不到Evernote。如何使用OAuth将oauth_token&oauth_verifier转换为Access令牌gem
到目前为止,我已经得到用户授权我的应用程序,现在有临时凭证:
customer = OAuth::Consumer.new("xxx", "xxx",{
:site=>"https://sandbox.evernote.com/",
:request_token_path => "/oauth",
:access_token_path => "/oauth",
:authorize_path => "/OAuth.action"})
@request_token = customer.get_request_token(:oauth_callback => "http://localhost:3000/create_evernote_step_2")
session[:request_token] = @request_token.token
session[:request_token_secret] = @request_token.secret
redirect_to @request_token.authorize_url
所以现在我有组oauth_token和oauth_verifier,并且需要将这些成访问令牌。 Twitter教程的这部分内容似乎与Twitter相关,因此我现在确定如何在Evernote中处理。谁能帮我吗?
如何在回调中获得@request_token?你在会话中存储对象,还是以某种方式重新创建对象? – alltom 2012-01-24 15:02:07