I have an ejabberd server set up to use authentication with an external Java script however when I try to log in to the server from my Java client using Smack I get the following SmackException:

No supported and enabled SASL Mechanism provided by server. Server announced 
mechanisms: [PLAIN, X-OAUTH2]. Registered SASL mechanisms with Smack: [SASL 
Mech: SCRAM-SHA-1-PLUS, Prio: 100, SASL Mech: SCRAM-SHA-1, Prio: 110, SASL 
Mech: DIGEST-MD5, Prio: 210, SASL Mech: PLAIN, Prio: 410, SASL Mech: X- 
OAUTH2, Prio: 410, SASL Mech: ANONYMOUS, Prio: 500, SASL Mech: EXTERNAL, 
Prio: 510]. Enabled SASL mechanisms for this connection: [EXTERNAL]. 
Blacklisted SASL mechanisms: [SCRAM-SHA-1-PLUS].

Presumably the "Registered SASL mechanisms with Smack:" and "Enabled SASL mechanisms for this connection:" mechanisms listed are set client-side (both of which show EXTERNAL in the above exception) but why does the server only announce the PLAIN and X-OAUTH2 mechanisms? Is there any way I can make the server announce EXTERNAL? For example, I know how to disable specific mechanisms in the ejabberd.yml file e.g.

disable_sasl_mechanisms: ["PLAIN", "X-OAUTH2"]

but there seems to be no equivalent for enabling mechanisms.

Here is what I currently have in the ejabberd.yml file under the AUTHENTICATION section:

auth_method: external
extauth_program: "java -jar /opt/ejabberd/conf/auth.jar"
extauth_instances: 1
auth_use_cache: false

Any thoughts as to what I am doing wrong?

  • SASL EXTERNAL is a completely different beast, see XEP-0178. With external script authentication you will be able to use SASL PLAIN only. So server behavior is correct. – user2610053 Apr 13 '18 at 20:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.