I've configured devise + omniauth as documented on omniauth wiki: https://github.com/intridea/omniauth/wiki/Setup-Phase
My initializer:
provider :twitter, nil, nil, setup: true
routes.rb:
get '/settings/auth/:provider/setup' => 'settings/authorization_callbacks#setup'
This is the setup action
def setup
application_id = params[:application_id].present? ? params[:application_id] : request.env["rack.session"]["omniauth.params"]["application_id"]
application = Application.find(application_id)
request.env['omniauth.strategy'].options[:client_id] = application.identifier
request.env['omniauth.strategy'].options[:client_secret] = application.secret
render :text => "Setup complete.", :status => 404
end
Result is 400 Bad Request and I have no idea why... I checked and the right application is called, setting the right values in the "omniauth.strategy".
Maybe someone who already implemented this can guess what's the problem with my code? Thanks in advance.