powered by Jive Software

ERROR: Authorization failed: 401

I am attempting to write a script that will interact with the jabber server. When I try and connect with the script I get - ERROR: Authorization failed: 401

I turned on debugging in the admin and this is what is returned.

2006.05.21 11:29:03 Connect Socket[addr=/XX.XX.XXX.XXX,port=38804,localport=5222]

2006.05.21 11:29:03 Logging off mydoman.com/c4217889 on org.jivesoftware.wildfire.net.SocketConnection@18d4c9a socket: Socket[addr=/XX.XX.XXX.XXX,port=38804,localport=5222] session: org.jivesoftware.wildfire.ClientSession@124e935 status: 1 address: mydomain.com/c4217889 id: c4217889 presence:

I am connecting to the right port as I can connect with a windows client program and it works fine.

I did a search and saw a post about adding a client but couldn’‘t find anything more on it. I’'ve tried 2 different scripts that I found online that are supposed to work. (One was from a post on this board.) Bothreturn the same 401 error.

Can anyone help?

I discovered what the error was on my end. I had not created a user on this(my) server. I was attempting to use a new jabber id that I had created a few days before.

My new question is this. Are my users going to have to create a new user on my server in order to talk to me? My main goal of this was to be able to talk to gmail users through this.


so you want to run a local Wifi server (and login there) and create a server connection to gmail? It may be a little bit complicated, there are some threads about s2s with gmail here but I assume that you succeed without problems and also adding buddies and viewing the online status runs fine. Whatever “your users” are, they would need to add your new JID to their roster.

If “your users” all work together with you it would be indeed a good idea to create new accounts on your server.

Another possibility could be to add a jabber transport to your server and use it to connect to gmail.


WiFi? No. I am actually writing a perl script that will log into my server and that will send and receive messages from jabber users world wide, including through gtalk. Currently, I can only communicate with users that have an account on my server.

Can you provide more information on jabber transport?

Wifi? == Wildfire

jabber-2-jabber was discussed in http://www.jivesoftware.org/community/thread.jspa?messageID=119414xmppgateway - http://jabberstudio.org/projects/xmppgateway/project/view.php”.

Currently, I can only communicate with users that have an account on my server.” So you need to setup a s2s-connection to one (gmail) or more other servers. I’'m not sure if you should run a local server to do this or if a direct connection to gmail / jabber.org / … would be much better.


Originally, I was planning on connecting directly to the gmail talk servers or the jabber.org server, but for some reason, my perl script will not connect. When I try to connect to the jabber.org, I get a 501 error and when I try to connect to the gmail server, it just hangs. Is there a listing of what all the codes stand for? I did a quick google search and didn’'t find anything usefull.

I’'ll look at that link once I get into work. Thanks

Another quick question… Wouldn’‘t the transporter be the same as the server 2 server already built into the wildfire? I have it enabled, but don’‘t know how to continue further on that. I looked over the site and couldn’'t find the documentation. Can someone point me to it?


the transport is indeed a replacement for s2s.

s2s works transparent, if you try to initiate a connection to a JID (eg foo@jivesoftware.com) which is not located/registered on your server it will try to establish a s2s connection (eg to jivesoftware.com).


error codes: http://www.jivesoftware.org/fisheye/viewrep/svn-org/messenger/trunk/src/java/org /jivesoftware/messenger/XMPPError.java?r=128 (after removing the ‘’ ‘’) or http://jabberwookie.com/javadoc/com/jabberwookie/ns/jabber/Error.html

Stupid question. If I use the transport then I will have to make my users use something like whatever.mydomain.com and then also use a different port. Is that correct?

Right, a stupid question No one has to use another port to use a transport. Whatever your users are, it may be much better to make them use mydomain.com as the jabber server and not a subdomain or are you using email addresses like foo@whatever.mydomain.com ?

Maybe you want to explain your use case so one can give you a more accurate advice.


This is my grand scheme.

I want to create a perl script that will allow gtalk users to send messages to. The script will receive the messages and will act accordingly.

I have the script written and it is connecting to my server ok, but when I try to connect it to another server, say like to jabber.org, I get errors (501 currently). My main goal would be to not have a server running on my box but to actually use a public one.

Update…I just tested my script and was able to recieve a message on my box from a gtalk user. Guess it just took time for the server to be propogated across the net.


so you should use the perl script and not a server to work around a connection problem. It sounds like a perl/xmpp problem, maybe an outdated Net:XMPP package? http://www.pervasive-network.org/SPIP/Google-Talk-with-perl-bis offers a short example.


Yeah. I’'ve tinkered with that code and it looks like there might be something wrong with it or a bug in the xmpp module.

I have another script that will allow me to send messages to and from it. The only problem is that I can only get it to connect to my server and not another. When I try others, I get either a 501 error or a 401 error. No biggie I guess. I can talk to it now so atleast I can continue to develop.

thanks for the answers.