public void ChangeHostBehavior(ServiceHostBase host) { var srvCredentials = new CoreWCF.Description.ServiceCredentials(); LdapSettings _ldapSettings = new LdapSettings("yourownserver.mscore.local", "mscore.local", "yourowntoporg"); srvCredentials.WindowsAuthentication.LdapSetting = _ldapSettings; host.Description.Behaviors.Add(srvCredentials); }
public ServiceCredentials Clone() { ServiceCredentials result = CloneCore(); if (result == null || result.GetType() != GetType()) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException(SR.Format(SR.CloneNotImplementedCorrectly, GetType(), (result != null) ? result.ToString() : "null"))); } return(result); }
protected ServiceCredentials(ServiceCredentials other) { if (other == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(other)); } UserNameAuthentication = new UserNamePasswordServiceCredential(other.UserNameAuthentication); ClientCertificate = new X509CertificateInitiatorServiceCredential(other.ClientCertificate); ServiceCertificate = new X509CertificateRecipientServiceCredential(other.ServiceCertificate); WindowsAuthentication = new WindowsServiceCredential(other.WindowsAuthentication); IssuedTokenAuthentication = new IssuedTokenServiceCredential(other.IssuedTokenAuthentication); SecureConversationAuthentication = new SecureConversationServiceCredential(other.SecureConversationAuthentication); _saveBootstrapTokenInSession = other._saveBootstrapTokenInSession; _exceptionMapper = other._exceptionMapper; }
protected ServiceCredentials(ServiceCredentials other) { if (other == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(other)); } userName = new UserNamePasswordServiceCredential(other.userName); clientCertificate = new X509CertificateInitiatorServiceCredential(other.clientCertificate); serviceCertificate = new X509CertificateRecipientServiceCredential(other.serviceCertificate); windows = new WindowsServiceCredential(other.windows); this.issuedToken = new IssuedTokenServiceCredential(other.issuedToken); this.secureConversation = new SecureConversationServiceCredential(other.secureConversation); saveBootstrapTokenInSession = other.saveBootstrapTokenInSession; exceptionMapper = other.exceptionMapper; }