我创建了一个 gem 来使用 Box API V2 ( https://github.com/youpdidou/omniauth-box/ )。我在开发中对其进行了测试。身份验证根据需要创建并记录在 DB 中,但在流程结束时重定向到我的页面时出现错误(参见下面的日志)。
我的应用程序可以与其他提供商一起正常工作(我有 Twitter 和 Yammer,使用omniauth-twitter 和omniauth-yammer gem),所以似乎错误可能来自我的Gem 中缺少的东西(与刷新令牌相关的东西?) ,或者它可能与 Box 身份验证过程有 2 个步骤(1 用于凭据,1 用于授权访问文件 - 参见http://developers.box.com/oauth/)的事实有关...
我在这里想念什么?如何调试这个,我应该看什么?
(box) Callback phase initiated.
Started GET "/auth/box/callback?state=7d550f7c0d367d4af73ca3a1d82985c78730126887e3e813&code=fV19In0Elnq1GNX61t32N1h8anezbTiH" for 127.0.0.1 at 2013-01-30 00:28:18 -0800
Processing by AuthenticationsController#create as HTML
Parameters: {"state"=>"7d550f7c0d367d4af73ca3a1d82985c78730126887e3e813", "code"=>"fV19In0Elnq1GNX61t32N1h8anezbTiH", "provider"=>"box"}
User Load (0.4ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 LIMIT 1
Authentication Load (0.5ms) SELECT `authentications`.* FROM `authentications` WHERE `authentications`.`user_id` = 1 AND `authentications`.`provider` = 'box' AND `authentications`.`uid` = '288560' LIMIT 1
(0.1ms) BEGIN
SQL (0.3ms) INSERT INTO `authentications` (`created_at`, `oauth_secret`, `oauth_token`, `provider`, `uid`, `updated_at`, `user_id`) VALUES ('2013-01-30 08:28:19', NULL, NULL, 'box', '288560', '2013-01-30 08:28:19', 1)
(1.5ms) COMMIT
(0.1ms) BEGIN
(0.4ms) UPDATE `authentications` SET `oauth_token` = 'cZga3uA89eslNAURbJlZaySukIs9IxTF', `updated_at` = '2013-01-30 08:28:19' WHERE `authentications`.`id` = 26
(0.5ms) COMMIT
Redirected to http://localhost:3000/services
Completed 302 Found in 14ms (ActiveRecord: 3.7ms)
[2013-01-30 00:28:19] ERROR Errno::ECONNRESET: Connection reset by peer
/Users/alex/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/httpserver.rb:80:in `eof?'
/Users/alex/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/httpserver.rb:80:in `run'
/Users/alex/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'