====== onAuthenticate() ====== wrtc.onAuthenticate() is an event function called when RTCgate or SIP server has requested authentication of the user. **Most of the time you do not need to do anything. Do not write any wrtc.onAuthenticate() function.** If you have not defined your own wrtc.onAuthenticate() function wrtc_kit will call [[ixnx:wrtc:js:api:line:authenticate|line.authenticate()]] automatically and carry out authentication using [[ixnx:wrtc:js:api:wrtc:sipauthname|wrtc.sipAuthName]] and [[ixnx:wrtc:js:api:wrtc:sippassword|wrtc.sipPassword]] or [[ixnx:wrtc:js:api:wrtc:sipha1|wrtc.sipHa1]] as indata. It will work sufficiently most of the times, except in complex use scenarios with different username/passwords for different realm domains. Advanced users may however implement their own authentication sequence by defining their own wrtc.onAuthenticate(), inspect its received realm domain and call [[ixnx:wrtc:js:api:line:authenticate|line.authenticate()]] with suitable username and password for the realm. ===== Arguments ===== wrtc.onAuthenticate(line, realm) * line - [[ixnx:wrtc:js:api:line:start|line]] object that raised the event * realm - string containing authentication realm, server path authentication request is coming from, eg "company.com" ===== Return value ===== Ignored.