Add server and login with ( Environment.AddServer, Environment.Login)

Hello, I am currently trying to add a server and log in with the Windows user, when I run the event trigger example I logged in without problem as shown in the image below

The problem is that this identification is through an external form of the library, I would like to do it manually by code

logging reports the error credentials used to get a token is invalid.

Host name: localhost’ I am not very clear where the problem may be, I probably know something simple that I have not finished detecting. I would appreciate it if someone could tell me where the problem is, thanks

This sample uses a coded login instead of the login dialog: https://doc.developer.milestonesys.com/html/index.html?base=samples/componentsamples/camerastreamresolution/readme.html&tree=tree_2.html