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 line.authenticate() automatically and carry out authentication using wrtc.sipAuthName and wrtc.sipPassword or 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 line.authenticate() with suitable username and password for the realm.
wrtc.onAuthenticate(line, realm)
Ignored.