This is the code:
internal BasicCredentialsConnection(string endPtUrl, string username, string password)
{
uri = new System.Uri(endPtUrl);
try
{
credentialCache = VideoOS.Platform.Login.Util.BuildCredentialCache(uri, username, password, "Basic");
VideoOS.Platform.SDK.Environment.AddServer(uri, credentialCache);
}
catch (System.Exception e)
{
throw new ConnectorException(e.Message + ". EndPointUrl: '" + EndPointUrl + "'", e);
}
Login();
}
/// <summary>
/// Perform authentication.
/// </summary>
/// <exception cref="ConnectorException">Connection, or authentication error.</exception>
private void Login()
{
try
{
VideoOS.Platform.SDK.Environment.Login(uri, false);
VideoOS.Platform.SDK.Environment.LoadConfiguration(uri);
}
catch (System.Exception e)
{
throw new ConnectorException(e.Message + ". EndPointUrl: '" + EndPointUrl + "'", e);
}
}