[ejabberd] ext. auth.

Leif Johansson leifj at it.su.se
Mon May 2 15:39:15 MSD 2005


Jon Phillips wrote:
> On Mon, 2005-05-02 at 09:42 +0200, Leif Johansson wrote:
> 
>>Jon Phillips wrote:
>>
>>>Are there any other external authentication script examples out there?
>>>I'm looking for an example of one that interfaces with msyql, gets
>>>username/password, and then okay/denies.
>>
>>
>>
>>>Will this then allow an authenticated user to use an ejabberd setup, or
>>>do other things need to be created first?
>>
>>I am using external auth with a kdc backend (the principle is the same).
>>All configuration in ejabberd is created when the user logs in the first
>>time.
>>
>>	MVH leifj
> 
> 
> Cool...could you email a sample of your script? Also, I'm kind of at a
> loss for the best way to develop this script to be honest. I have made
> the mysql all work, but there is so little documentation and no one is
> online on the channel when I ask...so I'm getting a little discouraged,
> but know this is the best path for using ejabberd (which I want to do).
> 

Use perl with DBI is my suggestion. Just rip the Authen::Krb5::Simple
calls from the attached script and replace with your application logic.
I suggest using ResourcePool from CPAN to create a DBI connection
resource-pool. This will allow your authentication service to reconnect
to the DB silently.

> Please email me with script samples, or hop on the chat. I'm in KOREA
> right now, so I would think there are many of the developers that are in
> a similar time zone to me...but maybe I'm wrong...
> 

WARNING this script is before the vhosting changes - nowadays you get an
extra argument from ejabberd (another part in the ($op,$user,$password)
list). Just rip out the authenticate call and replace it with a couple
of printf's and you'll quickly get the hang of it.

	MVH leifj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check_pass_krb5.pl
Type: application/x-perl
Size: 892 bytes
Desc: not available
Url : http://lists.jabber.ru/pipermail/ejabberd/attachments/20050502/8eded2e6/check_pass_krb5.pl


More information about the ejabberd mailing list