--
You received this message because you are subscribed to the Google Groups "Strophe" group.
To view this discussion on the web visit https://groups.google.com/d/msg/strophe/-/S3pBOXk3dmI2MHdK.
To post to this group, send email to str...@googlegroups.com.
To unsubscribe from this group, send email to strophe+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/strophe?hl=en.
You can always look at the ejabberd code for how its done :)
The way I've usually done this is to use one of the SQL backends and
just have my web app create the user's account directly in the
database, and skip the XMPP part. If your web app already has a user
table, you can even get ejabberd to use it by writing an auth plugin
or modifying the existing one, or perhaps in your database by mapping
the view ejabberd expects to your particular table.
jack.
--
--
You received this message because you are subscribed to the Google Groups "Strophe" group.
In band registration is highly discouraged because it allow anyone to
create an account on your server, not just Strophe. Most servers now
come with it turned off, although it used to be commonly enabled and
had fairly wide client support. I think it's useful only in a minimum
of cases, most of which you can solve by doing it at the web service
level.
Any server admin on ejabberd can use the web UI to manipulate accounts
or use Ad-Hoc Commands to so do over XMPP (or you can use the command
line tool, ejabberdctl).
Unfortunately, the command is likely to be ejabberd specific, so even
if I added direct support for it in strophe, it would only work for
some people.
I'm open to suggestions for making this better, but most people I've
talked to seem to use SQL databases and direct user creation.
jack.
{auth_method, external}.
{extauth_program, "/opt/ejabberd.cluster/sdbin/sd-auth"}.
buffer = String.newwhile STDIN.sysread(2, buffer) && buffer.length == 2length = buffer.unpack('n')[0]operation, username, domain, password =STDIN.sysread(length).split(':')member_id = usernameresponse = case operationwhen 'auth'auth ( member_id ? member_id : "" ), ( password ? password.chomp : "" )when 'isuser'isuser ( member_id ? member_id : "" )else0endSTDOUT.syswrite([2, response].pack('nn'))end
It looks like a great solution! Do you have any links where it is explained in detail? While I'd really like to learn Erlang (and hopefully I will finally start learning it soon :)), I'm not sure I have enough time right now, so any kind of tutorial would be really helpful :) I'd probably have to automatically generate another password just for XMPP account, because it's going to be displayed in plain text in javascript on the client side...Anyway, would it be possible to make ejabberd read subscription info from SQL database as well? One of the other XMPP related features of the site is that one can send an invitation to other users that can be accepted or rejected and it should automatically create proper XMPP subscription info based on these invitations. If I could just insert a record into the database without messing with sending messages and handling XMPP server responses on the server side it would be really awesome :)
--
You received this message because you are subscribed to the Google Groups "Strophe" group.
To view this discussion on the web visit https://groups.google.com/d/msg/strophe/-/cGJlbHVrMGpoYUVK.
Ack! Just do the auth on the server side and then pass authenticated
tokens in the JavaScript. That's what connection.attach() is for.
There's no need to leak passwords.
Another alternative would be to create a new auth method that used
tokens; this is what Google does.
> Anyway, would it be possible to make ejabberd read subscription info from
> SQL database as well? One of the other XMPP related features of the site is
> that one can send an invitation to other users that can be accepted or
> rejected and it should automatically create proper XMPP subscription info
> based on these invitations. If I could just insert a record into the
> database without messing with sending messages and handling XMPP server
> responses on the server side it would be really awesome :)
You can do this, but ejabberd has no way to no you've done it to
notify the various parties. That means it is unreliable at best. I do
not know a good way to do this at the moment. One solution might be
to store the invites themselves so that the next time the user logs in
they send them.
jack.
--
You received this message because you are subscribed to the Google Groups "Strophe" group.
By "connecting your backend w/ ejabberd" I am talking about making
normal HTTP requests via BOSH but from your backend instead of the
frontend. Not only does it not require any password juggling, but it
dramatically reduces startup latency.
jack.
jack.
You can easily fix this by making the request at the end of <body> for
a <script> that includes the credentials. If that script is slow, it's
not a big deal, doesn't block any rendering and the user just sees the
chat connection start slower if ejabberd is acting up, the same as if
you did it all client side. You can hide it further by loading a small
script which does dynamic <script> tag injection that gets the
credentials. Then it's no different than any other ajax request. You
can also use AJAX directly to a server side API that provides the
SID/RID.
(I'm not trying to convince you to change, just using you as a foil so
that others can see two alternatives in detail.)
jack.
jack.
registered_users doesn't work for external auth. It's kind of a silly
command anyway, since if your user base is huge it won't be very good
to enumerate them all :)
> @jack - do you have a link to a page describing how to hook up my own
> database to ejabberd (what's the db schema and so on)? Would it be possible
> to tell it to fetch just username and password from my db (e.g. from a view
> based on my current "users" table) and the rest from wherever ejabberd
> stores it by default?
The best I can do for you is show you my patch to change its format
that I made for chesspark for an old version of ejabberd:
http://metajack.im/2009/12/18/better-ejabberd-vhosts/
> 2. Attaching to existing BOSH session
> @jack - thanks a lot for this tip! The only problem is that I'd need
> something on the server side that talks BOSH, so I'd probably have to use
> strophe-ruby that looks a bit outdated... Do you know if it can work
> synchronously, so that I don't have to handle asynch callbacks on the server
> side?
Use your favorite http library and write your own?
jack.