====== sipHa1 ====== wrtc.sipHa1 is a string property containing a hash sum of the user's SIP password. It is used in SIP systems using [[ixnx:wrtc:js:digest_authentication_sequence|digest authentication]] to log in to SIP server. wrtc.sipHa1 is usually created by [[ixnx:wrtc:js:api:line:authenticate|line.authenticate()]] from [[ixnx:wrtc:js:api:wrtc:sippassword|wrtc.sipPassword]] containing the password in clear text. The hash sum is considered a much more secure storage form of the password than clear text. Therefore if you are storing user's SIP password in your code or in a cookie you should store wrtc.sipHa1 instead of [[ixnx:wrtc:js:api:wrtc:sippassword|wrtc.sipPassword]] that is considered a major security risk. If you want to store wrtc.sipHa1 in a cookie it should be done in [[ixnx:wrtc:js:api:wrtc:onloggedin|wrtc.onLoggedIn()]] as it is called after [[ixnx:wrtc:js:api:line:authenticate|line.authenticate()]] has created wrtc.sipHa1 and server has approved the login attempt. ===== Value ===== String containing hash sum of user's SIP password. ===== Default value ===== Undefined. ===== Usage ===== wrtc.sipHa1 is created and used by [[ixnx:wrtc:js:api:line:authenticate|line.authenticate()]]. First time ever you log in [[ixnx:wrtc:js:api:line:authenticate|line.authenticate()]] uses the value in [[ixnx:wrtc:js:api:wrtc:sippassword|wrtc.sipPassword]] to log you in and creates wrtc.sipHa1 in the process. From then on you should use wrtc.sipHa1 instead of wrtc.sipPassword to avoid storing the password in clear text. If you store password to a cookie you should store wrtc.sipHa1 instead of wrtc.sipPassword. Next time you start your client it reads from cookie and sets wrtc.sipHa1 usually in your [[ixnx:wrtc:js:api:wrtc:init|wrtc.init()]]. If you want to change contents of wrtc.sipHa1 at some later time you must call wrtc.changeName() to trigger a new SIP authentication (a new [[ixnx:wrtc:js:api:wrtc:onauthenticate|wrtc.onAuthenticate()]] event). If you want to store wrtc.sipHa1 in a cookie it should be done in [[ixnx:wrtc:js:api:wrtc:onloggedin|wrtc.onLoggedIn()]] as it is called after [[ixnx:wrtc:js:api:line:authenticate|line.authenticate()]] has created wrtc.sipHa1 and server has approved the login attempt. ===== See also ===== [[ixnx:wrtc:js:api:wrtc:sippassword|wrtc.sipPassword]] [[ixnx:wrtc:js:api:line:authenticate|line.authenticate()]] [[ixnx:wrtc:js:api:wrtc:onloggedin|wrtc.onLoggedIn()]] [[ixnx:wrtc:js:digest_authentication_sequence|Digest authentication sequence]]