我試圖從Linux機器上的shell使用sendxmpp發送Google Hangout消息。爲此,我安裝了最新的sendxmpp(1.24)。sendxmpp未授權失敗(錯誤AuthSend)
除認證失敗外,一切看起來不錯。 這是我使用命令:
echo "GTalk Test" | sendxmpp -v -t receiver.username
這是輸出:
sendxmpp: config: 'password' => '[sender.pass]'
sendxmpp: config: 'component' => 'gmail.com'
sendxmpp: config: 'jserver' => 'talk.google.com'
sendxmpp: config: 'username' => '[sender.username]'
sendxmpp: ssl_verify: 1
sendxmpp: tls_ca_path:
sendxmpp: Connect: 1
Use of uninitialized value in string eq at /usr/bin/sendxmpp line 518.
Error 'AuthSend': [?]
sendxmpp: Disconnect
我複製粘貼的用戶名和密碼進入Gmail的登錄頁面,以確保不存在錯別字。
我也打開了「安全性較低的應用程序」設置(https://www.google.com/settings/security/lesssecureapps)
此外,在此頁:https://security.google.com/settings/security/activity?pli=1&p的Gmail告訴我未知設備試圖登錄並防止這樣做吧。我已經告訴它它是我的,所以它不必擔心它,因爲我這樣做,沒有其他嘗試再出現在該屏幕上。
我也手動發送消息(成功)從和兩個帳戶,以確保它不被阻止在該級別。
,當我在調試(-d)開關,這是的輸出(最後部分):
XMPP::Conn: AuthSASL: shiney new auth
XML::Stream: Send: (<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>[hash]</auth>)
XMPP::Conn: AuthSASL: haven't authed yet... let's wait.
XMPP::Conn: Process: timeout(1)
XML::Stream: Read: buff(<failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized/></failure>)
XML::Stream: Read: buff(</stream:stream>)
XML::Stream: Read: buff()
XML::Stream: Read: ERROR
Use of uninitialized value in string eq at /usr/bin/sendxmpp line 518.
Error 'AuthSend': [?]
XML::Stream: Send: (</stream:stream>)
XML::Stream: SetCallBacks: tag(node) func(CODE(0x29855b8))
XMPP::Conn: Disconnect: bye bye
sendxmpp: Disconnect
我也嘗試添加@ gmail.com到我的用戶名(只是嘗試),但這也導致失敗(雖然略有不同:<invalid-authzid/>
)
所以,我知道它成功連接,我知道它使用正確的帳戶,但我仍然認證失敗。我還能嘗試什麼?
你是否啓用了雙因素驗證?如果是這樣,您需要創建一個特定於應用程序的密碼。 – xnyhps
我檢查了此頁:https://myaccount.google.com/security,它告訴我關閉了兩步驗證。 – marty