public override void ChangeHostBehavior(ServiceHostBase host) { var srvCredentials = new CoreWCF.Description.ServiceCredentials(); srvCredentials.UserNameAuthentication.UserNamePasswordValidationMode = CoreWCF.Security.UserNamePasswordValidationMode.Custom; srvCredentials.UserNameAuthentication.CustomUserNamePasswordValidator = new CustomTestValidator(); host.Description.Behaviors.Add(srvCredentials); }
public static void AddToHost(ServiceHostBase host) { var srvCredentials = new CoreWCF.Description.ServiceCredentials(); srvCredentials.UserNameAuthentication.UserNamePasswordValidationMode = CoreWCF.Security.UserNamePasswordValidationMode.Custom; srvCredentials.UserNameAuthentication.CustomUserNamePasswordValidator = new CustomUserNamePasswordValidatorCore(); host.Description.Behaviors.Add(srvCredentials); }
public override void ChangeHostBehavior(ServiceHostBase host) { var srvCredentials = new CoreWCF.Description.ServiceCredentials(); srvCredentials.ClientCertificate.Authentication.CertificateValidationMode = CoreWCF.Security.X509CertificateValidationMode.Custom; srvCredentials.ClientCertificate.Authentication.CustomCertificateValidator = new MyX509CertificateValidator(); srvCredentials.ServiceCertificate.Certificate = ServiceHelper.GetServiceCertificate(); host.Description.Behaviors.Add(srvCredentials); }
public override void ChangeHostBehavior(ServiceHostBase host) { var srvCredentials = new CoreWCF.Description.ServiceCredentials(); srvCredentials.ClientCertificate.Authentication.CertificateValidationMode = CoreWCF.Security.X509CertificateValidationMode.PeerOrChainTrust; srvCredentials.ClientCertificate.Authentication.TrustedStoreLocation = StoreLocation.CurrentUser; srvCredentials.ServiceCertificate.SetCertificate( StoreLocation.CurrentUser, StoreName.My, X509FindType.FindBySerialNumber, "16437c0e611928da"); host.Description.Behaviors.Add(srvCredentials); }
public override void ChangeHostBehavior(ServiceHostBase host) { var srvCredentials = new CoreWCF.Description.ServiceCredentials(); srvCredentials.ClientCertificate.Authentication.CertificateValidationMode = CoreWCF.Security.X509CertificateValidationMode.PeerOrChainTrust; srvCredentials.ClientCertificate.Authentication.TrustedStoreLocation = StoreLocation.LocalMachine; srvCredentials.ServiceCertificate.SetCertificate( StoreLocation.LocalMachine, StoreName.Root, X509FindType.FindBySubjectName , "birojtestcert" ); host.Description.Behaviors.Add(srvCredentials); }