DISQUS

L'Ouvre Boite: Authenticating Ejabberd against a Ruby On Rails database

  • Le Tribulateur · 1 year ago
    Trop barbu comme sujet pour que je m'imisce.
    I stay out of this Egghead topic...
  • julien51 · 1 year ago
    Tssstssstss! Come on, isn't Ruby a wonderful language that you can almost read like English?
  • Vladimir · 1 year ago
    Thank you for the post.

    Just now I am trying to add external auth for ejabberd against ruby on rails but I always get the following error message: "Authentication Error: No appropriate mechanism available for given security settings " (I use Psi as a client app).
    The first I tried to use your script w/o changes (connection settings were changed :) ).
    Then I have changed code of your script to more simple: remove all requires and simply return 1 for 'auth' and 'isuser'. But the issue appears as well.

    ejabberd.cfg settings:
    {auth_method, external}.
    {extauth_program, "/var/lib/ejabberd/bin/ejabberd-auth-simple.rb"}.

    Could you help me and advise who can I resolve this issue? Thanks.
  • julien51 · 12 months ago
    Hi Vladimir,

    I had the same kind of problem when I forgot to comment the "default" authentication lines ;-)
  • Vladimir · 12 months ago
    Before I switched to odbc authentication (using mysql db) and then I commended all other auth methods instead of 'external' one.
    As I see script is called everytime when I start ejabberd service. I added logging all actions into file what are performed by this script:
    ---
    File.open('/var/lib/ejabberd/auth.log', "w+") do |f|
    f.write("Starting authentication ...\n")
    ........
    ---
    When I start the service I see the zero-length log-file. So script was started but it is failed. After this script is not called (I remove log-file and try to connect by Psi and log-file is not created anymore).

    Btw, I have changed 'ejabberd' user shell to /bin/bash
  • Vladimir · 12 months ago
    I have resolved this problem :)
  • Vladimir · 11 months ago
    Do you know ejabberd has the ability to send a copy of a message to the external app/script or to another account (as CC:)?
    Thanks.