I am Using eJabberd-1.1.4 on CentOS 5.x.
I want to use External Authentication using a Linux Shell Script itself.
As a trial i have the following code. If Configured the Server for external auth with the following script, The Script getting executing while the server starting up.
After that, If try to Authenticate with the server, i am not getting data to the Script. The script keep on trying to read some thing from the Standard INPUT. But nothing is available forever.
I think i am doing some thing wrong it seems.
Please Help me out.
Thanks in advance.
- PC Varma
--- Server Config ---
% For authentication via external script use the following: {auth_method, external}. {extauth_program, "/home/ejabberd-1.1.4/auth/authConnector.sh"}. % Host name: {hosts, ["im.server.org","guest.server.org"]}. {host_config, "im.server.org", [{auth_method, external}]}.
-- Extauth Srcipt file --
#!/bin/sh # Init Log file located at /tmp/authConnector.log echo `date` "--- Log ---" > /tmp/authConnector.log echo `date` "Arguments : $*" >> /tmp/authConnector.log echo `date` "Starting Ext Auth Loop" >> /tmp/authConnector.log # # User defined vars # # Possibles states are 1 - 'run'(default), 0 - 'stop' state=1 while [ $state -eq 1 ] do echo `date` "Waiting for input from the eJabberd" >> /tmp/authConnector.log read params echo `date` "Params : $params" >> /tmp/authConnector.log # Do Authentication # For the time being, Just return Success echo "0201" done # # End of the Script #
pcvarma wrote: The script
The script keep on trying to read some thing from the Standard INPUT. But nothing is available forever.
I tried your config and script, and I get the same result that you: nothing is received by the script.
Then I tried the code used by ejabberd, rawly, with a simpler shell script based in your example. And didn't work either. It's interesting that there isn't any shell script for ejabberd' extauth.
By the way, ejabberd uses the 'Port drivers' feature included in Erlang for this purpose. Maybethe documentation gives you some clue on the problem.
If you already defined as global auth method 'external', you don't need that 'host_config' option. Anyway, that doesn't help this problem.