Extauth not working

Good afternoon.

I have an extauth script in php based on the MySQL authentication available here.

I cant seem to get it working. It looks like the script is being called and it's authenticating just fine but the client never seems to connect to the server.

Looking at the syslog output, I see...

May 10 12:22:09 server1 pipe-auth: Command : auth:apulo:gothicwars.org:ae9b4c2f45130a43c6182e51301ea61e ==> 1
May 10 12:22:09 server1 pipe-auth: RE:
May 10 12:22:09 server1 pipe-auth: OUT: 2

But the client never connects. Client in question is Pigin 2.10.4.

Thanks for any assistance you can give.

Could you try to login using

Could you try to login using another client?
Could you try to login using another auth method (to confirm correct client and server configuration)?
Could you confirm that your extauth script follows the specifications?
Could you show the relevant excerpt of ejabberd log in debug level?
How To Ask questions The Smart Way

Other clients experience the

Other clients experience the same issue.
I can log in just fine using odbc auth.
I am using the script located here http://www.ejabberd.im/check_mysql_php with my own additions to hash the password and check it against a MyBB user database (which is working correctly according to the script logs).

ejabberd.log:

=INFO REPORT==== 2012-05-10 16:42:12 === D(<0.562.0>:ejabberd_receiver:320) : Received XML on stream =
"<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'
xmlns:ga='http://www.google.com/talk/protocol/auth'
ga:client-uses-full-bind-result='true'>AGFwdWxvAGIxbnFsZXk=</auth>"

=INFO REPORT==== 2012-05-10 16:42:12 ===
D(<0.562.0>:shaper:61) : State: {maxrate,1000,0,1336686132403522}, Size=183
M=91.5, I=94.718

=ERROR REPORT==== 2012-05-10 16:42:34 ===
E(<0.561.0>:extauth:133) : extauth call '["auth","apulo","gothicwars.org",
                                          "*******"]' didn't receive response

Extauth script log:

May 10 16:42:34 server1 pipe-auth: Starting pipe-auth ...
May 10 16:42:34 server1 pipe-auth: Reading 33 bytes ...
May 10 16:42:34 server1 pipe-auth: IN: auth:apulo:gothicwars.org:*******
May 10 16:42:34 server1 pipe-auth: GO: auth:apulo:gothicwars.org:*******
May 10 16:42:34 server1 pipe-auth: data length is : 33
May 10 16:42:34 server1 pipe-auth: MySQL :: Connected
May 10 16:42:34 server1 pipe-auth: Command was : auth
May 10 16:42:34 server1 pipe-auth: MySQL :: Connected
May 10 16:42:34 server1 pipe-auth: Command : auth:apulo:gothicwars.org:ae9b4c2f45130a43c6182e51301ea61e ==> 1
May 10 16:42:34 server1 pipe-auth: RE:
May 10 16:42:34 server1 pipe-auth: OUT: 2

Apulo

Apulo wrote:

ejabberd.log:

...
=ERROR REPORT==== 2012-05-10 16:42:34 ===
E(<0.561.0>:extauth:133) : extauth call '["auth","apulo","gothicwars.org",
                                          "*******"]' didn't receive response

Extauth script log:

...
May 10 16:42:34 server1 pipe-auth: Command : auth:apulo:gothicwars.org:ae9b4c2f45130a43c6182e51301ea61e ==> 1
May 10 16:42:34 server1 pipe-auth: RE:
May 10 16:42:34 server1 pipe-auth: OUT: 2
check_mysql.php.txt wrote:
        function play()
        {
        ...
                        $ret = $this->command(); // play with data !
                        $this->logg("RE: " . $ret); // this is what WE send.
                        $this->out($ret); // send what we reply.
        ...
        }
        function command()
        {
        ...
                        if(strlen($data[0]) > 0 && strlen($parms) > 0) {
                                $this->logg("Command : ".$data[0].":".$parms." ==> ".$return." ");
                        }
                        return @pack("nn", 2, $return);
        ...
        }
        function out($message)
        {
                @fwrite($this->stdout, $message); // We reply ...
                $dump = @unpack("nn", $message);
                $dump = $dump["n"];
                $this->logg("OUT: ". $dump);
        }

Your script messed up the returned value. The Command() has the "1" inside it, but it never returned.
You could have figured it out yourself if inspected logs thoughtfully.

mikekaganski wrote: Apulo

mikekaganski wrote:
Apulo wrote:

ejabberd.log:

...
=ERROR REPORT==== 2012-05-10 16:42:34 ===
E(<0.561.0>:extauth:133) : extauth call '["auth","apulo","gothicwars.org",
                                          "*******"]' didn't receive response

Extauth script log:

...
May 10 16:42:34 server1 pipe-auth: Command : auth:apulo:gothicwars.org:ae9b4c2f45130a43c6182e51301ea61e ==> 1
May 10 16:42:34 server1 pipe-auth: RE:
May 10 16:42:34 server1 pipe-auth: OUT: 2
check_mysql.php.txt wrote:
        function play()
        {
        ...
                        $ret = $this->command(); // play with data !
                        $this->logg("RE: " . $ret); // this is what WE send.
                        $this->out($ret); // send what we reply.
        ...
        }
        function command()
        {
        ...
                        if(strlen($data[0]) > 0 && strlen($parms) > 0) {
                                $this->logg("Command : ".$data[0].":".$parms." ==> ".$return." ");
                        }
                        return @pack("nn", 2, $return);
        ...
        }
        function out($message)
        {
                @fwrite($this->stdout, $message); // We reply ...
                $dump = @unpack("nn", $message);
                $dump = $dump["n"];
                $this->logg("OUT: ". $dump);
        }

Your script messed up the returned value. The Command() has the "1" inside it, but it never returned.
You could have figured it out yourself if inspected logs thoughtfully.

I'm confused. Isn't this command writing the reply back using php://stdout?
@fwrite($this->stdout, $message); // We reply ..

You'll have to forgive my level of experience with this. I'm used to PHP browser based scripting, I'm fairly new to using it to write command line scripts.

I finally got it working.

I finally got it working. Thanks for your help!

hi Apulo, I am facing same

hi Apulo,

I am facing same error. can you tell me how did you solve that.

thanks

Syndicate content