agsXMPP.XmppClientConnection.ChangePassword C# (CSharp) Method

ChangePassword() public method

Changing the Password. You should use this function only when connected with SSL or TLS because the password is sent in plain text over the connection.

After this request was successful the new password is set automatically in the Username Property

public ChangePassword ( string newPass ) : void
newPass string value of the new password
return void
		public void ChangePassword(string newPass)
		{
			/*
			
			Example 10. Password Change
			<iq type='set' to='somehost' id='change1'>
			<query xmlns='jabber:iq:register'>
				<username>bill</username>
				<password>newpass</password>
			</query>
			</iq>			    

			Because the password change request contains the password in plain text,
			a client SHOULD NOT send such a request unless the underlying stream is encrypted 
			(using SSL or TLS) and the client has verified that the server certificate is signed 
			by a trusted certificate authority. A given domain MAY choose to disable password 
			changes if the stream is not properly encrypted, or to disable in-band password 
			changes entirely.

			If the user provides an empty password element or a password element that contains 
			no XML character data (i.e., either <password/> or <password></password>),
			the server or service MUST NOT change the password to a null value, 
			but instead MUST maintain the existing password.

			Example 11. Host Informs Client of Successful Password Change

			<iq type='result' id='change1'/>			
			*/

			RegisterIq regIq  = new RegisterIq(IqType.set, new Jid(base.Server));			
			regIq.Query.Username = this.m_Username;
			regIq.Query.Password = newPass;
			
			IqGrabber.SendIq(regIq, new IqCB(OnChangePasswordResult), newPass);
		}