A camera must be correctly configured for authentication via the ONVIF protocol to work.
Make sure that ONVIF is enabled in the camera settings. The precise procedure for how this is done depends on the make and model of the camera.
The canmera's configured date & time must not differ by more than +/- 5 seconds from the machine you're connecting the camera to. Follow these steps to ensure that the camera date & time are configured correctly:
time.google.com
and port 123
.The end result should be that the camera's date and time are up-to-date and that the NTP service is enabled to keep it up-to-date.
Some camera web UIs will show an incorrect/strange/nonsensical time after you've set the time zone to your local time zone. Do not change the time zone away from your local time zone! It must be set to the local time zone for ONVIF authentication to work.
Many cameras maintain two sets of users: one set of web users and a second (and independent) set of ONVIF users. These cameras with 2 sets of users do not automatically create an ONVIF user even when a new web user is created.
Be sure that your camera has at least one ONVIF user with administration privileges. If there aren't any ONVIF with administration privileges, ONVIF authentication will not work.