 						if ( !loggedIn )
 						{
 							configureAuthMechanisms( feature );
-							beginAuthentication();
+							if ( ( username != null && username.length > 0 ) || useAnonymousLogin )
+							{
+								beginAuthentication();
+							}
 						}
 						break;
 					case "compression":

				switch (localName)
				{
					case "starttls":
						handleStreamTLS( feature ); // Checks for 'required'
						break;
					case "register":
						// In-Band Registration, if enabled.... TODO

		}

		/**
		 * SASL Authentication should been set up, begin the authentication
		 * process by sending the initial request.
		 *
		 * <p>Make sure that the username and password are set, or the connection is using
		 * anonymous authentication before calling this method.</p>
		 */
		protected function beginAuthentication():void
		{
