Authlogic_Oauth调用GET / user_sessions

时间:2011-03-17 05:14:09

标签: ruby-on-rails-3 authlogic linkedin authlogic-oauth

我正在编写一个rails 3应用程序,我正试图让人们使用LinkedIn签名_in或sign_up。我已经按照https://github.com/datawrangling/linkedin_on_rails的教程进行了操作,但是我得到了一些奇怪的结果。出于某种原因,应用程序在POST / user_sessions之后调用/ user_sessions上的GET,后者将我的凭据发送到LinkedIn。这是rails服务器的日志:

Started POST "/user_sessions" for 127.0.0.1 at 2011-03-16 21:56:13 -0700
Processing by UserSessionsController#create as HTML
Parameters: {"utf8"=>"✓","authenticity_token"=>"M+W0ExS4FZE5wg/hPI6FzL4dnAGdTS/yllQWqOoSNRs=", 
"user_session"=>{"username"=>"", "password"=>"[FILTERED]", "remember_me"=>"0"},
"login_with_oauth"=>"Login with LinkedIn"}
Redirected to https://www.linkedin.com/uas/oauth/authenticate?oauth_token=76e56c85-3896-419a-ab94-15a05332d04b
Completed 302 Found in 455ms


Started GET "/user_sessions?oauth_token=76e56c85-3896-419a-ab94-15a05332d04b&oauth_verifier=86765" for 127.0.0.1 at 2011-03-16 21:56:13 -0700
Processing by UserSessionsController#index as HTML
Parameters: {"oauth_token"=>"76e56c85-3896-419a-ab94-15a05332d04b", "oauth_verifier"=>"86765"}
Rendered layouts/_stylesheets.html.erb (1.9ms)
Rendered layouts/_header.html.erb (78.3ms)
Rendered layouts/_footer.html.erb (3.3ms)
Rendered user_sessions/index.html.erb within layouts/application (94.6ms)
Completed 200 OK in 103ms (Views: 101.3ms | ActiveRecord: 0.0ms)

我已经删除了:user_sessions控制器的索引,这样我就不会因错误而失败:

No route matches "/user_sessions"

但我不明白为什么我没有被重定向到登录页面中的链接然后又回到我的应用程序。任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:1)

您是否已登录LinkedIn?你是否已经批准了你的申请?

如果是这样,那就是为什么你没有看到LinkedIn登录界面。