Software / code / prosody
Comparison
plugins/mod_dialback.lua @ 3651:337391d34b70
s2s: SASL EXTERNAL
| author | Paul Aurich <paul@darkrain42.org> |
|---|---|
| date | Sun, 21 Nov 2010 21:10:43 -0800 |
| parent | 3534:c68590b13a6d |
| child | 4238:05f991b4a90e |
comparison
equal
deleted
inserted
replaced
| 3650:2b80450bd7ae | 3651:337391d34b70 |
|---|---|
| 130 end | 130 end |
| 131 return true; | 131 return true; |
| 132 end | 132 end |
| 133 end); | 133 end); |
| 134 | 134 |
| 135 module:hook_stanza("urn:ietf:params:xml:ns:xmpp-sasl", "failure", function (origin, stanza) | |
| 136 if origin.external_auth == "failed" then | |
| 137 module:log("debug", "SASL EXTERNAL failed, falling back to dialback"); | |
| 138 s2s_initiate_dialback(origin); | |
| 139 return true; | |
| 140 end | |
| 141 end, 100); | |
| 142 | |
| 135 module:hook_stanza(xmlns_stream, "features", function (origin, stanza) | 143 module:hook_stanza(xmlns_stream, "features", function (origin, stanza) |
| 136 s2s_initiate_dialback(origin); | 144 if not origin.external_auth or origin.external_auth == "failed" then |
| 137 return true; | 145 s2s_initiate_dialback(origin); |
| 146 return true; | |
| 147 end | |
| 138 end, 100); | 148 end, 100); |
| 139 | 149 |
| 140 -- Offer dialback to incoming hosts | 150 -- Offer dialback to incoming hosts |
| 141 module:hook("s2s-stream-features", function (data) | 151 module:hook("s2s-stream-features", function (data) |
| 142 data.features:tag("dialback", { xmlns='urn:xmpp:features:dialback' }):tag("optional"):up():up(); | 152 data.features:tag("dialback", { xmlns='urn:xmpp:features:dialback' }):tag("optional"):up():up(); |