在xmpp4r_facebook上进行身份验证时出现“IOError:closed stream”错误

时间:2013-04-24 07:15:35

标签: facebook xmpp xmpp4r

这很奇怪,因为它曾经工作过,现在却没有。如果它是'Not Authorized'错误,那会很容易,但是对于“IOError:closed stream”,我很难过。

我认为这可能是由于过期令牌造成的,但只要用户使用Facebook登录,访问令牌就会更新。

由于遇到错误,我逐步尝试并发现在调用auth_sasl方法时会发生错误。

1.9.3p194 :073 > c = Jabber::Client.new(Jabber::JID.new("-[FB_ID]@chat.facebook.com"))
[output omitted]
1.9.3p194 :074 > c.connect
[output omitted]
1.9.3p194 :079 > c.is_connected?
=> true 
1.9.3p194 :080 > c.auth_sasl(Jabber::SASL::XFacebookPlatform.new(c, [FB_KEY], [TOKEN], [FB_SECRET]), nil)
IOError: closed stream
    from /Users/yangtheman/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/openssl/buffering.rb:318:in `syswrite'
    from /Users/yangtheman/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/openssl/buffering.rb:318:in `do_write'
    from /Users/yangtheman/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/openssl/buffering.rb:383:in `<<'
    from /Users/yangtheman/.rvm/gems/ruby-1.9.3-p194@global/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:346:in `block in send_data'
    from <internal:prelude>:10:in `synchronize'
    from /Users/yangtheman/.rvm/gems/ruby-1.9.3-p194@global/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:344:in `send_data'
    from /Users/yangtheman/.rvm/gems/ruby-1.9.3-p194@global/gems/xmpp4r-0.5/lib/xmpp4r/stream.rb:378:in `send'
    from /Users/yangtheman/.rvm/gems/ruby-1.9.3-p194@global/gems/xmpp4r_facebook-0.1.1/lib/xmpp4r_facebook.rb:11:in `initialize'
    from (irb):80:in `new'
    from (irb):80
    from /Users/yangtheman/.rvm/gems/ruby-1.9.3-p194@global/gems/railties-3.2.11/lib/rails/commands/console.rb:47:in `start'
    from /Users/yangtheman/.rvm/gems/ruby-1.9.3-p194@global/gems/railties-3.2.11/lib/rails/commands/console.rb:8:in `start'
    from /Users/yangtheman/.rvm/gems/ruby-1.9.3-p194@global/gems/railties-3.2.11/lib/rails/commands.rb:41:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
1.9.3p194 :081 > c.is_connected?
=> false 

有谁可以请说明为什么会发生这种情况?其他人有相同或类似的问题?

编辑:我打开了调试,以下是我收到的“错误”消息。同样,似乎很多人都有同样的问题,但对于我能找到的问题没有任何解决方案或解释。大:(。

<subject>Sorry, your account isn&apos;t available</subject><body>Your account is temporarily unavailable. Regain access by logging into your account from a web browser.</body></message>

非常感谢任何帮助!

谢谢,

1 个答案:

答案 0 :(得分:0)

在多个操作系统上遇到同样的问题&amp;客户端 - 肯定是服务器端问题,但没有得到FB对此问题的任何响应。 我在FB中启用2FA后问题开始出现 - 不确定它是否是根本原因。聊天很重要,但FB提供的小“安全性”更是如此。