Login to milestone server failed

Hi Guys,

Can help me..

i am using MIP SDK 2018R1, and written windows service program to programmatically login and send events/alarms for this i referred from CameraStreamResolution and LibraryEventGenerator, but i could not able to

login.

where as the same program if use in console i can login and send events/alarms

error: Invalid credentials for: VideoOS.Platform.SDK.Platform.InvalidCredentialsMIPException: The request failed with HTTP status 401: Unauthorized.

This code is open for many “types” of login depending on the variables. A common issue, and my guess for what you have, is to use current credential and then have the service running with a user that does not have access, does not belong to a role setup for the XProtect system.

One a way to solve this (amongst others); use current Windows user (DefaultNetworkCredentials) in your coding of your service, in Windows setup a service user with a password that does not change or expire, add the service user to an appropriate role (might be the Administrators role), and for your service set the “Log on as” user to be the service user.

(-This is a bit more complicated but much more flexible that just coding with a hardcoded login.)

Thanks that’s worked for me.