of XEP-0078 - non-SASL authentication for Jabber sessions.
This is a deprecated protocol but some clients (such as
CenterIM) still seem to use it.
if (!CC->logged_in) {
/* If we're not logged in yet, offer SASL as our feature set */
xmpp_output_auth_mechs();
+
+ /* Also offer non-SASL authentication */
+ cprintf("<auth xmlns=\"http://jabber.org/features/iq-auth\"/>");
}
/* Offer binding and sessions as part of our feature set */
void xmpp_presence_notify(char *, char *);
void jabber_roster_item(struct CitContext *);
void jabber_send_message(char *, char *);
+void jabber_offer_non_sasl_authentication(void);
/*
* Is this a query we know how to handle?
*/
+
if (!strcasecmp(query_xmlns, "jabber:iq:roster:query")) {
jabber_iq_roster_query();
}
+ else if (!strcasecmp(query_xmlns, "jabber:iq:auth")) {
+ jabber_offer_non_sasl_authentication();
+ }
+
/*
* End of query result. If we didn't hit any known namespaces then we will
* have simply delivered an empty result stanza, which should be ok.
}
}
+/*
+ * Offer non-SASL authentication to legacy clients.
+ */
+void jabber_offer_non_sasl_authentication(void) {
+ cprintf("<query xmlns=\"jabber:iq:auth\">"
+ "<username/>"
+ "<password/>"
+ /* "<digest/>" */
+ /* "<resource/>" */
+ "</query>"
+ );
+}
+
#endif /* HAVE_EXPAT */