NoamB/sorcery — Issue #230: twitter redirect misses '?' in url
Author: emiltin
Created: 2012-03-03 22:39:15+00:00
State: open

using latest 0.7.7 -

after authentication via twitter, the callback redirects to "/oauth/callbackprovider=twitter....", appearently missing a '?' between 'callback' and 'provider'.

this happens if i use a callback url of "0.0.0.0:3000" or "localhost:3000", but not if i use "www.localhost:3000" (i have this setup in my hosts file), i don't get this problem. this might indicate that it's related to the subdomain level and how sorcery parses the domain when redirecting?

#initializers/sorcery.rb
config.twitter.key = TWITTER_CLIENT_ID
config.twitter.secret = TWITTER_CLIENT_SECRET
config.twitter.callback_url = "http://0.0.0.0:3000/oauth/callback?provider=twitter"
config.twitter.user_info_mapping = { :username => "name"}

#console output
[....]

Started GET "/oauth/callback?provider=twitter&oauth_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx&oauth_verifier=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx" for 127.0.0.1 at 2012-03-03 23:19:47 +0100
Processing by OauthsController#callback as HTML
Parameters: {"provider"=>"twitter", "oauth_token"=>"xxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "oauth_verifier"=>"xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
Redirected to http://www.localhost:3000/oauth/callbackprovider=twitter&oauth_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx&oauth_verifier=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Completed 302 Found in 0ms

Started GET "/oauth/callbackprovider=twitter&oauth_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx&oauth_verifier=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx" for 127.0.0.1 at 2012-03-03 23:19:47 +0100
Processing by OauthsController#oauth as HTML
Parameters: {"provider"=>"callbackprovider=twitter&oauth_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx&oauth_verifier=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}
Completed 500 Internal Server Error in 0ms

NoMethodError (undefined method `callbackprovider=twitter&oauth_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx&oauth_verifier=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx' for Sorcery::Controller::Config:Module):
app/controllers/oauths_controller.rb:7:in `oauth'