private void JabberClient_OnSASLStart(Object sender, jabber.connection.sasl.SASLProcessor proc)
        {
            BaseState s = null;

            lock (StateLock)
            {
                s = State;
            }

            // HACK: fire OnSASLStart with state of NonSASLAuthState to initiate old-style auth.
            if (s == NonSASLAuthState.Instance)
            {
                if ((bool)this[Options.AUTO_LOGIN_THISPASS])
                {
                    Login();
                }
                else
                {
                    LoginRequired(ManualLoginState.Instance);
                }
            }
            else
            {
                if ((bool)this[Options.AUTO_LOGIN_THISPASS])
                {
                    // TODO: integrate SASL params into XmppStream params
                    proc[SASLProcessor.USERNAME] = User;
                    proc[SASLProcessor.PASSWORD] = Password;
                    proc[MD5Processor.REALM]     = this.Server;
                    object creds = this[KerbProcessor.USE_WINDOWS_CREDS];
                    if (creds == null)
                    {
                        creds = false;
                    }
                    proc[KerbProcessor.USE_WINDOWS_CREDS] = creds.ToString();
                }
                else
                {
                    LoginRequired(ManualSASLLoginState.Instance);
                }
            }
        }
Example #2
0
        private void JabberService_OnSASLStart(object sender, jabber.connection.sasl.SASLProcessor proc)
        {
            jabber.connection.BaseState s = null;
            lock (StateLock)
            {
                s = State;
            }

            if (s == jabber.connection.NonSASLAuthState.Instance)
            {
                lock (StateLock)
                {
                    State = HandshakingState.Instance;
                }

                if (this.Type == ComponentType.Accept)
                {
                    Handshake hand = new Handshake(this.Document);
                    hand.SetAuth(this.Secret, StreamID);
                    Write(hand);
                }
            }
        }