Sendxmpp auth error with ejabberd (SOLVED)

From SysAdm
Jump to navigation Jump to search

05.2020 FreeBSD 12.1

  • Problem: Sendxmpp cant connect to ejabber with DIGEST-MD5 mechanism
  • Solution 1: force PLAIN auth:
    • file /usr/local/lib/perl5/site_perl/XML/Stream.pm line 2254:
my $sasl = Authen::SASL->new(mechanism=>join(" ",@{$mechanisms}),

change to

my $sasl = Authen::SASL->new(mechanism=>'PLAIN',
  • Solution 2: Problem with DIGEST-MD5 is authzid field supplied in 1st responce, so we can just remove it:
    • file /usr/local/lib/perl5/site_perl/Authen/SASL/Perl/DIGEST_MD5.pm line 286:

comment out

  if (defined $authzid) {
    $response{authzid} = $authzid;
  }
  • Solution 3: Problem with authzid field is the it have incorrect value (from ejabberd's view):

ejabberd takes only 2 possible values of authzid - empty (Solution 2) or username (without @domain), but perl Authen:SASL:Perl send 'username@domain' value. We can correct this:

    • file /usr/local/lib/perl5/site_perl/Authen/SASL/Perl/DIGEST_MD5.pm line 285:
  my $authzid = $self->_call('authname');

change to

  my $authzid = $self->_call('user');