Subject: My xmpp object doesn't get authenticated in my ASP.Net chat application
Hello,
I need to create a chat application with ASP.Net where users can login with their google talk account and can chat with their friends.
For some reason when i try to connect with the xmpp, the xmpp doesn't get authenticated.
Here is the code:
Note: the username is only the username without @gmail.com
I need to create a chat application with ASP.Net where users can login with their google talk account and can chat with their friends.
For some reason when i try to connect with the xmpp, the xmpp doesn't get authenticated.
Here is the code:
- /// <summary>
- /// Creates a xmpp object and connects it to google talk with as username the text in the username textbox and as password the text in the password textbox
- /// </summary>
- private void login()
- {
- xmpp = (XmppClientConnection)Session["xmpp"];
- if (xmpp == null)
- {
- Session["xmpp"] = xmpp;
- }
- string user = tbxUsername.Text;
- string password = tbxPassword.Text;
- xmpp.AutoPresence = true;
- xmpp.AutoResolveConnectServer = true;
- xmpp.Port = 5222;
- xmpp.Server = "gmail.com";
- xmpp.ConnectServer = "talk.google.com";
- xmpp.Username = tbxUsername.Text;
- xmpp.Password = tbxPassword.Text;
- xmpp.Open();
- xmpp.SendMyPresence();
- while (xmpp.Authenticated == false)
- {
- System.Threading.Thread.Sleep(10);
- }
- linkEvents();
- Session["client"] = client;
- //xmpp.Open();
- #region Enable and disable buttons
- btnLogin.Enabled = false;
- btnLogout.Enabled = true;
- btnSend.Enabled = true;
- btnChatUser.Enabled = true;
- #endregion
- UpdatePanelMessageBox.Update();
- UpdatePannelChatBox.Update();
- }
SamBrands
Show profile
Link to this post
