User authorization in google talk with nodejs and node-xmpp

I am writing a bot in node.js using node-xmpp. So far, it's pretty straightforward, except that I had a problem figuring out how Google Talk handles its user authorization (when accessing a chat with someone NOT on your list).

I will catch all the stanzas that pass and register them on the console, but there is no data coming from the user requesting authorization.

Any explanations of what I should look for, or if this event even occurs via jabber protocol.

[added] I know that technically, when a subscription request is made, the presence stanza is sent with a subscription request. For some reason, I don’t see how they cross the wire using node-xmpp. In addition, I need to figure out a way to determine which presence requests are “waiting” when my bot logs in. I thought (unequivocally) that they would be listed in the list with some kind of flag, but this is not true.

Any help in determining where to go from here would be helpful.

+4
source share
2 answers

Well, I finally figured out how to get subscription requests after creating them. There is not much information about this, so I am collecting a blog post, but I feel that the answer to it here may also be good.

I found that if I ran a google list request based on the information below:

http://code.google.com/apis/talk/jep_extensions/roster_attributes.html

Stanza example:

<iq from=" username@gmail.com /D2D4E5A8" type="get" id="google-roster-1"><query xmlns="jabber:iq:roster" xmlns:gr="google:roster" gr:ext="2"/></iq> 

The server will respond first with your subscription attendance expectations.

Example:

 <presence type="subscribe" from=" pendinguser@gmail.com " to=" namehere@gmail.com /D2D4E5A8" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client"/> 

and then the rest of your “present” stanzas. It is important to note that your subscribed "present" stanzas are not sent to you from the server if you do not fulfill the request in the form of a list. I am not sure why this is so, and why it is not documented somewhere far from me. In any case, at least I can get a list of people trying to access my bot.

+5
source

Note. This is not my area of ​​knowledge, but only my interest. I have no practical experience with just a little research. It would be a comment, however, after making a few more searches on this topic, I came up with something else that might help.

Here in google chat chat you can get the http://code.google.com/p/partychapp/ source at http://partychapp.appspot.com/

These links came from http://xmpp.org/2010/02/xmpp-roundup-13-services/ , which has many other resources that can be useful.

http://code.google.com/p/node-xmpp-bosh/ has some code about this, I haven’t done this, but the topic is interesting.

I hope that if you find the answer to your question after you write a blog post and / or project, and share it. That would be interesting to me.

+1
source

All Articles