After reviewing strophe.js (within the body of _connect_cb function) I've found that vars do_sasl_digest_md5,
do_sasl_plain and do_sasl_anonymous are used to select the SASL auth
mechanism that should be used .
Since it's possible to have custom auth mechanisms, IMO it would
be nice to have methods like PyXMPP's challenge which would make
strophe more flexible & easy-to-extend . I mean , the actual code
looks like a well known anti-pattern , and it would be nice to be able
to register «auth handlers» and select the correct match considering
the value of mech var .
... in that case it would be possible to add custom auth without
patching strophe.js by executing auth_mechs['MY_METHOD'] = handle_MY_METHOD similar to what is possible in PyXMPP by
implementing and registering ClientAuthenticator subclasses .
After reviewing
strophe.js
(within the body of_connect_cb
function) I've found that varsdo_sasl_digest_md5
,do_sasl_plain
anddo_sasl_anonymous
are used to select the SASL auth mechanism that should be used .Since it's possible to have custom auth mechanisms, IMO it would be nice to have methods like PyXMPP's
challenge
which would make strophe more flexible & easy-to-extend . I mean , the actual code looks like a well known anti-pattern , and it would be nice to be able to register «auth handlers» and select the correct match considering the value ofmech
var .IOW do something like
... in that case it would be possible to add custom auth without patching strophe.js by executing
auth_mechs['MY_METHOD'] = handle_MY_METHOD
similar to what is possible in PyXMPP by implementing and registeringClientAuthenticator
subclasses .