An user credential can login both management client and smart client, but, got error Invalid credential: The request failed with HTTP status 401: Unauthorized.is the user need to be authorized to use SDK? How? Thank you.

Below is the partial code:

  Uri uri = new Uri("[http://localhost](http://localhost)");

  string userName = "jinmin";

  string password = "sdk4cag$";

  Application.EnableVisualStyles();

  Application.SetCompatibleTextRenderingDefault(false);

  VideoOS.Platform.SDK.Environment.Initialize();     // General initialize. Always required

  try

  {

    VideoOS.Platform.SDK.Environment.AddServer(uri, new System.Net.NetworkCredential(userName, password));

    VideoOS.Platform.SDK.Environment.Login(uri, true);

  }

  catch (ServerNotFoundMIPException snfe)

  {

    MessageBox.Show("Server not found: " + snfe.Message);

    return;

  }

  catch (InvalidCredentialsMIPException ice)

  {

    MessageBox.Show("Invalid credentials for: " + ice.Message);

    return;

  }

Hi. I suspect that you might be mixing Windows authentication users with Basic users. Please see if the VideoViewer sample using a login dialog works for you,

also see if the CameraStreamResolution sample using a hardcoded login works for you.

Hi Rie Kito,

The user, jinmin is a Basic user and able to login both management client and smart client.
But, the same user is not able to login through SDK programming.

Using MIPLibrary login dialog, this user, jinmin has no problem login.

Please found the screenshots blow.

Regards,
Jinmin

[cid:image005.png@01D56E3B.FD4E9890]

[cid:image002.png@01D56CB0.4B8096E0]

[cid:image003.png@01D56E0D.FEBA2560]

[cid:image010.png@01D56E0D.FEBA2560]

Hi Rie Kito,

By using the login approach of sample CameraStreamResolution,
We are able to login through SDK. Thank you for your assistance.

Regards,
Jinmin