[jdev] XEP-0070 in PHP

Magnus Henoch mange at freemail.hu
Sat Oct 28 16:20:25 CDT 2006

I got bored and tried to implement the server side of XEP-0070
(verifying HTTP requests via XMPP) in PHP.

Try it here: http://www.dtek.chalmers.se/~henoch/jabberauth/index.php4
Source:      http://www.dtek.chalmers.se/~henoch/jabberauth/index.txt

Enter your Jabber ID as username, and any random text as password.

It seemed to be overkill to have a separate component for this, so my
PHP script acts as a client (using class.jabber.php).  It sends a
<message/> to the given JID, as described in the XEP, with both
<body/> and <confirm/> elements.

In theory, acting as a client should mean that responses are
automagically sent to the correct web server thread, as the user would
reply to the same full JID which sent the original stanza.  In
practice, some clients (e.g. Gajim) reply to the bare JID.  As my
script doesn't send any presence, it won't get such messages...

Testing and comments are welcome.

JID: legoscia at jabber.cd.chalmers.se

More information about the JDev mailing list