FederatedMessageSecurityOverHttp.NegotiateServiceCredential 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
指定是否已进行消息级 SSL 协商以获取服务的证书。
public:
property bool NegotiateServiceCredential { bool get(); void set(bool value); };
public bool NegotiateServiceCredential { get; set; }
member this.NegotiateServiceCredential : bool with get, set
Public Property NegotiateServiceCredential As Boolean
属性值
如果已协商服务证书,则为 true
;如果可以在带外使用服务证书,则为 false
。 默认值为 true
。
示例
下面的代码演示如何从绑定中访问此属性并设置它。
// This method creates a WSFederationHttpBinding.
public static WSFederationHttpBinding
CreateWSFederationHttpBinding(bool isClient)
{
// Create an instance of the WSFederationHttpBinding.
WSFederationHttpBinding b = new WSFederationHttpBinding();
// Set the security mode to Message.
b.Security.Mode = WSFederationHttpSecurityMode.Message;
// Set the Algorithm Suite to Basic256Rsa15.
b.Security.Message.AlgorithmSuite = SecurityAlgorithmSuite.Basic256Rsa15;
// Set NegotiateServiceCredential to true.
b.Security.Message.NegotiateServiceCredential = true;
' This method creates a WSFederationHttpBinding.
Public Shared Function CreateWSFederationHttpBinding(ByVal isClient As Boolean) As WSFederationHttpBinding
' Create an instance of the WSFederationHttpBinding.
Dim b As New WSFederationHttpBinding()
' Set the security mode to Message.
b.Security.Mode = WSFederationHttpSecurityMode.Message
' Set the Algorithm Suite to Basic256Rsa15.
b.Security.Message.AlgorithmSuite = SecurityAlgorithmSuite.Basic256Rsa15
' Set NegotiateServiceCredential to true.
b.Security.Message.NegotiateServiceCredential = True
注解
此属性指示是否在客户端和服务之间自动协商服务证书。 如果此属性为 true
,则会进行此类协商。 如果此属性为 false
,则与服务通信之前必须在客户端指定服务证书。
服务必须始终指定一个证书。
如果此属性为 true,则在请求通过 IssuerAddress 和 IssuerBinding 属性指定的安全令牌服务颁布安全令牌之前,将进行服务证书的消息级 SSL 协商。