private void SetLoginUser(UserAuthenticationOption userAuthentication)
{
string domain = string.Empty;
string userName = string.Empty;
string userPassword = string.Empty;
switch (userAuthentication)
{
case UserAuthenticationOption.Authenticated:
domain = Common.GetConfigurationPropertyValue(Constants.Domain, this.Site);
userName = Common.GetConfigurationPropertyValue(Constants.UserName, this.Site);
userPassword = Common.GetConfigurationPropertyValue(Constants.Password, this.Site);
break;
case UserAuthenticationOption.Unauthenticated:
domain = Common.GetConfigurationPropertyValue(Constants.UnauthorizedUserDomain, this.Site);
userName = Common.GetConfigurationPropertyValue(Constants.UnauthorizedUserName, this.Site);
userPassword = Common.GetConfigurationPropertyValue(Constants.UnauthorizedUserPassword, this.Site);
break;
}
this.service.Credentials = new NetworkCredential(userName, userPassword, domain);
}
}