Not logged in. · Lost password · Register
Forum: agsXMPP RSS
I am using AgsXmpp dll for register user but its not registering nor logging in
ismail.nmsq #1
Member for a month · 2 posts
Group memberships: Members
Show profile · Link to this post
Subject: Unable to login or register user
Below is my code please help me on this,

  1. using agsXMPP;
  2. using agsXMPP.protocol.client;
  3. using System.Diagnostics;
  4. using agsXMPP.protocol.iq.roster;
  5. using agsXMPP.Xml.Dom;
  6. using agsXMPP.sasl;
  7.  
  8. XmppClientConnection xmpp = new XmppClientConnection();
  9.  
  10. public async Task<bool> XMPPValidateUser(string jabberId, string jabberPassword)
  11.         {
  12.             string userId = jabberId.Split("@")[0];
  13.             string server = jabberId.Split("@")[1];
  14.  
  15.             try
  16.             {
  17.                 xmpp.AutoResolveConnectServer = true;
  18.                 xmpp.Port = 5222;
  19.                 xmpp.UseSSL = false;
  20.                 xmpp.Server = server;
  21.                 xmpp.Username = userId;
  22.                 xmpp.Password = jabberPassword;
  23.                 xmpp.RegisterAccount = false;
  24.                 xmpp.Open();
  25.                 xmpp.OnLogin += new ObjectHandler(xmpp_OnLogin);
  26.                 return xmpp.Authenticated;
  27.             }
  28.             catch (Exception ex)
  29.             {
  30.                  return false;
  31.             }
  32.         }
  33. public async Task<bool> XMPPCreateUser(string jabberId, string jabberPassword)
  34.         {
  35.             string userId = jabberId.Split("@")[0];
  36.             string server = jabberId.Split("@")[1];
  37.  
  38.             try
  39.             {
  40.                 xmpp.AutoResolveConnectServer = true;
  41.                 xmpp.Port = 5222;
  42.                 xmpp.UseSSL = false;
  43.                 xmpp.Server = server;
  44.                 xmpp.Username = userId;
  45.                 xmpp.Password = jabberPassword;
  46.                 xmpp.RegisterAccount = true;
  47.                 xmpp.Open();
  48.                 xmpp.OnLogin += new ObjectHandler(xmpp_OnLogin);
  49.                 //xmpp.OnError += new ErrorHandler(xmpp_OnError);
  50.             }
  51.             catch (Exception ex)
  52.             {                
  53.                 return false;
  54.             }
  55.             return true;
  56.         }
  57.          
  58.  
  59.  public async void xmpp_OnLogin(object sender)
  60.         {
  61.             try
  62.             {
  63.                 xmpp.Close();
  64.             }
  65.             catch (Exception ex)
  66.             {
  67.                
  68.             }
  69.         }
This post was edited on 2019-11-07, 16:52 by Alex.
Edit reason: added code formatting
Avatar
Alex #2
Member since Feb 2003 · 4308 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I would need to see your XML log to see your XML streams. Can you subscribe to teh receive and send xml handlers and send your log?
Also, why are you using still agsXMPP and not the newer libraries MatriX or MatriX vNext?

Alex
ismail.nmsq #3
Member for a month · 2 posts
Group memberships: Members
Show profile · Link to this post
Hi Thanks for your quick replay,
Are these two libraries MatriX or MatriX vNext free?
And agsXmpp free?

Thank you.
This post was edited on 2019-11-08, 07:59 by ismail.nmsq.
Avatar
Alex #4
Member since Feb 2003 · 4308 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Quote by ismail.nmsq:
Hi Thanks for your quick replay,
Are these two libraries MatriX or MatriX vNext free?
And agsXmpp free?

Thank you.

agsXMPP is GPL or commercial licensed
MatriX is commercial license only
MatriX vNext is GPL or commercial

so MatriX vNext and agsXMPP are under the same license.

If you are not familiar with the GPL then please read and understand it.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS