ejabberdejabberd-auth

Integrated EJabberd Login with existing Script1


I have quiet decent knowledge how to use Ejabberd. Have used a lot with Smack Library for android so am quiet comfortable as a user. However I face use case that I have not faced before.

There exists as system with its users and login interfaces both using forms and another using API. Now I need to integrate it with ejabberd. The most common and documented way is to use ejabberd OAuth2 but now am supposed to do the opposite.

Reading the docs the best I found is this link talking about external script. However there are no enough information to help build something. Linked examples are old and links are dead.

Can anyone help me get into right direction with external script login? I would prefer PHP based solution but any other language will help.


Solution

  • However there are no enough information to help build something.

    Brief protocol description, and example in Python: https://docs.ejabberd.im/developer/guide/#external

    Perl example included with ejabberd. Notice this file was last modified 11 years ago, and it still works correctly: https://github.com/processone/ejabberd/tree/master/examples/extauth

    Linked examples are old and links are dead.

    Right, those other examples are very old too, but they could work (as long as you can get them, and use the ancient language versions they used): https://ejabberd.im/extauth

    Why are those so old? Because that page has not been updated since years ago (back when git was not yet mainstream). Quite probably, if you search, you may find other examples.