我正在尝试通过使用 ServiceSecurityContext.Current.WindowsIdentity.Name来获取客户端的服务凭据。 但是,ServiceSecurityContext.Current作为null出现。在客户端获取服务凭据
该服务和客户端正在使用Windows身份验证,消息安全模式和wsHttpBinding。你的帮助是非常appriciated ..谢谢。
我正在尝试通过使用 ServiceSecurityContext.Current.WindowsIdentity.Name来获取客户端的服务凭据。 但是,ServiceSecurityContext.Current作为null出现。在客户端获取服务凭据
该服务和客户端正在使用Windows身份验证,消息安全模式和wsHttpBinding。你的帮助是非常appriciated ..谢谢。
如果你试图在客户端获得服务器的证书,那么你可能会做一些错误的事情。 如果你正在做它的其他明智的,你必须使用以下设置
BasicHttpBinding basicHttpBinding = new BasicHttpBinding(BasicHttpSecurityMode.TransportCredentialOnly);
basicHttpBinding.Security.Transport.ClientCredentialType =HttpClientCredentialType.Windows;
reportService = new ReportingService2005SoapClient(basicHttpBinding, new EndpointAddress(reportServerUrl));
reportService.ClientCredentials.Windows.AllowNtlm = false;
reportService.ClientCredentials.Windows.AllowedImpersonationLevel = TokenImpersonationLevel.Impersonation;
reportService.ChannelFactory.Credentials.Windows.ClientCredential =
CredentialCache.DefaultNetworkCredentials;
编辑
使用这个类来获得关于在运行一个远程安全上下文 信息。当客户端 成功通过身份验证并授权访问方法时,会创建安全上下文。当成功验证和授权的 消息,可以 从这个类的一个实例
你们是不是在服务器或服务器证书获取客户端证书获得来自客户和当前服务实例的安全 信息在客户端? – Anand