Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么';我的WCF端点不会引发最大时钟偏移异常吗?_Wcf_Wcf Security - Fatal编程技术网

为什么';我的WCF端点不会引发最大时钟偏移异常吗?

为什么';我的WCF端点不会引发最大时钟偏移异常吗?,wcf,wcf-security,Wcf,Wcf Security,对于我的应用程序中几乎所有(安全的)WCF服务端点,如果客户端的系统时钟在将来或过去设置得太远,我会从WCFs时钟倾斜机制(此处描述)中得到一个异常 但是,实现my Login()方法的一个端点从未引发此异常,即使它启用了传输安全性(当然不需要凭据) 为什么“时钟偏移机制”不适用于此端点?可能是因为clientCredentialType设置为“无” 例如,下面是我的配置的简化版本: <services> <service name="Foo">

对于我的应用程序中几乎所有(安全的)WCF服务端点,如果客户端的系统时钟在将来或过去设置得太远,我会从WCFs时钟倾斜机制(此处描述)中得到一个异常

但是,实现my Login()方法的一个端点从未引发此异常,即使它启用了传输安全性(当然不需要凭据)

为什么“时钟偏移机制”不适用于此端点?可能是因为clientCredentialType设置为“无”

例如,下面是我的配置的简化版本:

<services>
    <service name="Foo">
        <endpoint address=""
            binding="wsHttpBinding"
            bindingConfiguration="binding1"
            contract="IFoo" />
    </service>
</services>

<bindings>
    <wsHttpBinding> 
        <binding name="binding1" maxReceivedMessageSize="100000000">
            <readerQuotas maxDepth="1000000000" maxArrayLength="1000000000" maxStringContentLength="1000000000" />
            <security mode="Transport">
                <transport clientCredentialType ="None"/>
            </security>
            <reliableSession enabled="false" />
        </binding>
    </wsHttpBinding>    
</bindings>     

其他人也有类似的问题:

因此,我不认为这是一个与您的配置问题

看起来,如果它不使用机器时间,它不会检查机器之间是否存在时间差


您可以围绕它进行编程,将客户端计算机时间作为登录方法中的参数发送,如果它不同,则引发异常。

安全模式-security mode=“Transport”-不包括消息中的时间戳,这会导致MaxClockSkew验证忽略消息而不引发安全异常。 将安全模式更改为安全模式=“TransportWithMessageCredential”,其中包括时间戳,并允许MaxClockSkew验证测试消息的时间增量