I'm writing a rails 3 app and I'm trying to let people sign_in or sign_up using LinkedIn. I've followed the tutorial at https://github.com/datawrangling/linkedin_on_rails but I'm getting some weird results. For some reason, the application is calling a GET on /user_sessions after the POST /user_sessions which sends my credentials to LinkedIn. This is the log from rails server:
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)
I've stubbed out :index for the user_sessions controller so that I don't fail with the error:
No route matches "/user_sessions"
but I don't understand why I'm not being redirected to the linked in login page and then back to my app. Any help would be greatly appreciated.
Are you already logged in to LinkedIn? And did you authorize your application already?
If so, thats why you don't see the LinkedIn login screen.