SecureConversationSecurityTokenParameters.RequireCancellation 属性      
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置一个值,该值指示是否需要取消。
public:
 property bool RequireCancellation { bool get(); void set(bool value); };public bool RequireCancellation { get; set; }member this.RequireCancellation : bool with get, setPublic Property RequireCancellation As Boolean属性值
如果需要取消,则为 true;否则为 false。 默认值为 true。
注解
当Windows 身份验证与安全上下文令牌结合使用时,WCF 不会使用实际调用方标识填充WindowsIdentity属性,而是将该属性设置为匿名。 由于 WCF 安全性必须为传入的安全上下文令牌中的每个请求重新创建服务安全上下文的内容,因此服务器不会跟踪内存中的安全会话。 因为不可能将 WindowsIdentity 实例序列化为安全上下文令牌,所以 WindowsIdentity 属性返回一个匿名标识。
下面的配置演示这一行为。
<customBinding>  
  <binding name="Cancellation">  
       <textMessageEncoding />  
        <security   
            requireSecurityContextCancellation="false">  
              <secureConversationBootstrap   
                 requireSecurityContextCancellation="true" />  
      </security>  
    <httpTransport />  
  </binding>  
</customBinding>  
有关安全上下文令牌的详细信息,请参阅 如何:为安全会话创建安全上下文令牌。