108 condition = condition .. ": " .. text; |
108 condition = condition .. ": " .. text; |
109 end |
109 end |
110 module:log("info", "SASL EXTERNAL with %s failed: %s", session.to_host, condition); |
110 module:log("info", "SASL EXTERNAL with %s failed: %s", session.to_host, condition); |
111 |
111 |
112 session.external_auth = "failed" |
112 session.external_auth = "failed" |
|
113 session.external_auth_failure_reason = condition; |
113 end, 500) |
114 end, 500) |
114 |
115 |
115 module:hook_stanza(xmlns_sasl, "failure", function (session, stanza) |
116 module:hook_stanza(xmlns_sasl, "failure", function (session, stanza) |
116 session.log("debug", "No fallback from SASL EXTERNAL failure, giving up"); |
117 session.log("debug", "No fallback from SASL EXTERNAL failure, giving up"); |
117 session:close(); |
118 session:close(nil, session.external_auth_failure_reason); |
118 return true; |
119 return true; |
119 end, 90) |
120 end, 90) |
120 |
121 |
121 module:hook_tag("http://etherx.jabber.org/streams", "features", function (session, stanza) |
122 module:hook_tag("http://etherx.jabber.org/streams", "features", function (session, stanza) |
122 if session.type ~= "s2sout_unauthed" or not session.secure then return; end |
123 if session.type ~= "s2sout_unauthed" or not session.secure then return; end |