Not logged in. · Lost password · Register
Forum: agsXMPP RSS
how can i use account with special char
Avatar
chinull #1
Member since Apr 2007 · 11 posts
Group memberships: Members
Show profile · Link to this post
Subject: About Login with a unicode account
In the sasl.Mechanism class the Username property is define like this
        /// <summary>
        ///
        /// </summary>
        public string Username
        {
            // lower case that until i implement our c# port of libIDN
            get { return m_Username; }
            set { m_Username = value != null ? value.ToLower() : null; }
        }
I found if I use account like '??' and so on , It could not login success by SSL way. Is there any way deal with it?
Avatar
Alex #2
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
the latest code from SVN has build in stringprep.
Try to checkout this code from SVN and run your username thru the stringprep functions before you assign it.
I will add some code which does this automatically and commit it to SVN as soon as possible.

We moved the SVN repositoy. The new URL is:
http://svn.ag-software.de/ags/trunk/

Alex
Avatar
chinull #3
Member since Apr 2007 · 11 posts
Group memberships: Members
Show profile · Link to this post
thanks?in sasl.Mechanism
        /// <summary>
        ///
        /// </summary>
        public string Username
        {
            // lower case that until i implement our c# port of libIDN
            get { return m_Username; }
            set { m_Username = value != null ? Stringprep.nameprep(value,true) : null; }
        }
then in Dom.Element
        public string TextBase64
        {
            get
            {
                byte[] b = Convert.FromBase64String(Value);
                return Encoding.ASCII.GetString(b, 0, b.Length);
            }
            set
            {
                byte[] b = Encoding.UTF8.GetBytes(value);//change Default to UTF8
                this.Value = Convert.ToBase64String(b, 0, b.Length);
            }
        }
then is OK now
Avatar
Alex #4
Member since Feb 2003 · 4317 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
yes this will work.

But this should be done in the Username property in XmppClientConnection. The Username in the SASL authentication gets set automatically from the Username property in XmppClientConnection. I will update the code and upload it to SVN as soon as possible.

Alex
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