If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Thunderbird Chat and Slack XMPP gateway don't connect

RESOLVED FIXED in Instantbird 42

Status

Chat Core
XMPP
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: Michael Fleming, Assigned: aleth)

Tracking

Instantbird 42
Unspecified
Mac OS X

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 4 obsolete attachments)

(Reporter)

Description

2 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.130 Safari/537.36

Steps to reproduce:

[Perhaps should be "Product: Chat Core"]

1) Make a team with slack.com
2) Enable the XMPP gateway on that team (go to https://TEAMNAME.slack.com/admin/settings#permissions and turn on XMPP under "Gateways"
3) Follow instructions to fill out Thunderbird chat account dialog. Be sure to select "Allow sending the password unencrypted" because this is the only option that appears to use START-TLS on port 5222, which is all Slack XMPP supports (the actual password will definitely not be sent unencrypted, it will only be sent after START-TLS occurs)




Actual results:

Thunderbird chat disconnects after Slack XMPP gateway sends a bind result:

What I believe Slack's XMPP server sends:

<iq xmlns="jabber:client" from="testteam-mikef.xmpp.dev.slack.com" to="newxmpp@testteam-mikef.xmpp.dev.slack.com/Thunderbird" type="result" id="b4633a7d-f172-5349-9e0f-5b85ec6518c4"><zdef1647982679:bind xmlns:zdef1647982679="urn:ietf:params:xml:ns:xmpp-bind"><jid>newxmpp@testteam-mikef.xmpp.dev.slack.com/Thunderbird</jid></zdef1647982679:bind></iq>

What's printed by the Thunderbird debug log before it disconnects:

<iq xmlns="jabber:client" from="testteam-mikef.xmpp.dev.slack.com" to="newxmpp@testteam-mikef.xmpp.dev.slack.com/Thunderbird" type="result" id="b4633a7d-f172-5349-9e0f-5b85ec6518c4">
 <zdef1647982679:bind xmlns="urn:ietf:params:xml:ns:xmpp-bind">
  <jid xmlns="jabber:client">
   newxmpp@testteam-mikef.xmpp.dev.slack.com/Thunderbird
  </jid>
 </zdef1647982679:bind>
</iq>



Expected results:

Successful connection

Note: Reach out to mikef@slack-corp.com if I can help make this work by changing things on Slack's side.
(Reporter)

Updated

2 years ago
Component: Untriaged → XMPP
OS: Unspecified → Mac OS X
Product: Thunderbird → Chat Core
Version: 38 → 1.5
(Reporter)

Comment 1

2 years ago
Here's a test team + user I created for you:

JID: testuser@xmpp-test.xmpp.slack.com
Password: xmpp-test.0BIcuAVperRJ8Y3vg6a8

Try joining MUC "general" on conference.xmpp-test.xmpp.slack.com
(Assignee)

Comment 2

2 years ago
Created attachment 8638497 [details] [diff] [review]
WIP using localName instead of qName to query XML nodes

WIP that gets a bit further in the connection process. Now fails later on with "server closed the connection".
(Assignee)

Updated

2 years ago
Assignee: nobody → aleth
(Assignee)

Comment 3

2 years ago
Created attachment 8638508 [details] [diff] [review]
WIP using localName instead of qName to query XML nodes, v2

With this WIP, the account successfully connects, but the server disconnects us immediately afterwards.

There are also "Error: Failed to decode base64 string!" when atob()-decoding the BINVAL image in each roster item.
Attachment #8638497 - Attachment is obsolete: true
(Assignee)

Comment 4

2 years ago
Mike responded that the reason for the disconnect is that JS-XMPP sends the iq set for the vcard with <zdef-902553532:vCard xmlns="vcard-temp">, i.e. incorrectly mirroring the namespace used by the server in iq result.
Flags: needinfo?(mikef)
(Assignee)

Comment 5

2 years ago
Created attachment 8638694 [details] [diff] [review]
WIP fixing namespace issues, v3

Fixes the namespace on the vcard we send out.

With this patch, it's possible to connect to Slack and stay connected, and join MUCs.

The base64 issue remains unsolved.
Attachment #8638508 - Attachment is obsolete: true
(Assignee)

Updated

2 years ago
Flags: needinfo?(mikef)
(Assignee)

Comment 6

2 years ago
Created attachment 8638746 [details] [diff] [review]
WIP fixing namespace issues and atob parsing, v4

Mozilla's atob() has problems when there is padding (=, ==) in the middle of the base64 string to be parsed, so we have to parse the lines separately and concatenate.

With this WIP, the Slack vcard icons are parsed correctly.
Attachment #8638694 - Attachment is obsolete: true
(Assignee)

Comment 7

2 years ago
Created attachment 8638749 [details] [diff] [review]
xmppslack.diff

Putting this up for review.
Attachment #8638746 - Attachment is obsolete: true
Attachment #8638749 - Flags: review?(clokep)
(Assignee)

Updated

2 years ago
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Comment on attachment 8638749 [details] [diff] [review]
xmppslack.diff

Review of attachment 8638749 [details] [diff] [review]:
-----------------------------------------------------------------

It'd be nice to have some test cases for the base64 decoded data. Or at least attach it to this bug.
Attachment #8638749 - Flags: review?(clokep) → review+
(Assignee)

Comment 9

2 years ago
url:        https://hg.mozilla.org/comm-central/rev/315831486f3428dbb77170e9cfb6c0f920328ec3
changeset:  315831486f3428dbb77170e9cfb6c0f920328ec3
user:       aleth <aleth@instantbird.org>
date:       Sat Jul 25 01:35:18 2015 +0200
description:
Bug 1186463 - Handle XML namespaces and base64 parsing better to allow connecting to Slack XMPP gateway. r=clokep
(Assignee)

Updated

2 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.6
(Assignee)

Comment 10

2 years ago
(In reply to Patrick Cloke [:clokep] from comment #8)
> It'd be nice to have some test cases for the base64 decoded data. Or at
> least attach it to this bug.

Sample base64 BINVAL with padding from Slack's XMPP:
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAE70lEQVRIx62UXUxbZRzGG7NNXYKO0bVMgQ1amLSWUvpJW5A5cBoxLkzD/EoWvfBGo8a4C5TNZRPDnHrnhYk3emMclA1GaTm0ZUCzZDq+hpnTlcLYaM857/loKS0fmvie854eEGgLm8mTk9M25/k97/P/90hIm3LzituVJ/WFO1T5UrWoPKkiR6o/sOfsOZl3XOYZlfWNrJZkSwDapsRtyqqygp2IcSBXqpBKG4/KLvTK/H+usb4fADoEZlHkqPKyi3ZLjao9X3wtu/I7p43c7wcAtWguaFLJH36tUdbukfn/Wl/LAwCsCrJczrxoCjt+tv0ayPJNpLHeOsCYT+qfBE3vgeBkfOkf1x1cio1IMwLApoOTL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8jeqs5vQAoSgy+c6AwSPzCWd397GX62HwQ5XGNO5IGQCoqBvjw3RkLr6wPBmcOv1pU7VBV20oz2i9WQBcpwHP5VA4fLmz65X6F6xaGNy0SffMAF/vpasD7ksXfnr3+JswOCx989aZAYPe7iGf83zLqWpTRem+PKtOU2e3/G+AqwOui7/8ePxYg0axX1tSpFeVQNWY9XU2y4MCYC39WOdXZ5vteq2qML+itBi5wxuTpnSrJ/gXYDIiqwnuVBYAAAAASUVORK5CYII=

We should consider adding tests.
Updating milestone from 1.6 to 42.
Target Milestone: 1.6 → Instantbird 42
You need to log in before you can comment on or make changes to this bug.