powered by Jive Software

Agsxmpp authentication error

Hello, i’m creating a simple Xmpp client in VB.NET using Agsxmpp library. My problemis I can’t login to my server but the username and the password are correct. Here is the code. It returns me the error “Wrong login” which is defined on the Private Sub login_onlogin.

Could you tell me why I get this error ?

I’m able to use C# language if it’s easier for you. Thanks in advance.

Imports agsXMPP
Imports agsXMPP.protocol.client
Imports agsXMPP.Sasl
Imports System.Diagnostics
Imports System.Xml Public Class Login
    Private login As New XmppClientConnection
    Public Sub New()         InitializeComponent()
        AddHandler login.OnLogin, New ObjectHandler(AddressOf login_onlogin)
        AddHandler login.OnAuthError, New XmppElementHandler(AddressOf login_onerror)     End Sub
    Private Username As String
    Private Sub login_onerror(ByVal sender As Object, ByVal e As agsXMPP.Xml.Dom.Element)
        If InvokeRequired Then
            BeginInvoke(New XmppElementHandler(AddressOf login_onerror), New Object() {sender, e})
            Return         End If
        MessageBox.Show("Wrong login")
    End Sub
    Private Sub login_onlogin(ByVal sender As Object)
        If InvokeRequired Then
            BeginInvoke(New ObjectHandler(AddressOf login_onlogin), New Object() {sender})
            Return
        End If
        MessageBox.Show("Login OK")
    End Sub     Private Sub loginxmpp()
        login.Server = "192.168.1.5"
        login.ConnectServer = "192.168.1.5"
        login.Username = TextBox1.Text
        login.Password = TextBox2.Text
        login.Port = 5222
        login.Open()
    End Sub
    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        loginxmpp()     End Sub
End Class