C# 检索SOAP密码

C# 检索SOAP密码,c#,security,soap,C#,Security,Soap,我正在使用WCF在C#中开发web服务,我想创建一种处理安全性的自定义方法。我找到了从发送到web服务的soap消息中检索用户名的方法: String username = System.ServiceModel.ServiceSecurityContext.Current.PrimaryIdentity.Name; 我想知道是否有类似的方法从SOAP消息中检索密码 谢谢根据所使用的WS-Security位,密码可能不在消息中。可能存在密码哈希或类似kerberos令牌的内容 除非消息通过安全

我正在使用WCF在C#中开发web服务,我想创建一种处理安全性的自定义方法。我找到了从发送到web服务的soap消息中检索用户名的方法:

String username = System.ServiceModel.ServiceSecurityContext.Current.PrimaryIdentity.Name;
我想知道是否有类似的方法从SOAP消息中检索密码


谢谢

根据所使用的WS-Security位,密码可能不在消息中。可能存在密码哈希或类似kerberos令牌的内容

除非消息通过安全通道(例如SSH)传递,否则您不希望消息包含密码