maxClockSkew不会超过5分钟?!(即使我明确设置)

时间:2011-06-24 15:38:19

标签: wcf-binding

我正在尝试将我的WCF服务的maxClockSkew设置为高于5分钟(默认值),但我没有成功。当我想将它与authenticationMode =“UserNameOverTransport”一起设置时,它看起来有问题。我需要这个,因为我的服务器在https下运行,我将使用自定义身份验证提供程序对用户进行身份验证。服务器初始化没有错误,但是值不会在5分钟(00:05:00)之间发生变化......而且我总是从客户端收到恼人的消息说

  

安全时间戳无效,因为其创建时间('2011-06-24T15:31:22.338Z')将来。当前时间是'2011-06-24T15:21:30.923Z'并允许时钟偏差是'00:05:00'。

在这里,您可以看到我的整个服务配置文件:

<?xml version="1.0"?> <configuration>
<system.web>
    <compilation debug="true"/>
</system.web>
<system.serviceModel>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true">
    </serviceHostingEnvironment>
    <services>
        <service name="MYSERVICE">
            <endpoint address=""  binding="customBinding" bindingConfiguration="HTTP"  contract="MYCONTRACT">
                <identity>
                    <dns value="https://localhost"/>
                </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
            <host>
                <baseAddresses>
                    <add baseAddress="https://localhost/service"/>
                </baseAddresses>
            </host>
        </service>
    </services>
    <behaviors>
        <serviceBehaviors>
            <behavior>
                <serviceMetadata httpGetEnabled="False" httpsGetEnabled="True" />
                <serviceDebug includeExceptionDetailInFaults="False"/>
                <serviceCredentials>
                    <userNameAuthentication userNamePasswordValidationMode="Custom"
                        customUserNamePasswordValidatorType="CUSTOMServiceCredentialsValidator, ASSEMBLY" />
                </serviceCredentials>
            </behavior>
        </serviceBehaviors>
    </behaviors>
    <bindings>
        <customBinding>
            <binding name="HTTP">
                <transactionFlow />
                <textMessageEncoding>
                    <readerQuotas maxStringContentLength="2147483647"/>
                </textMessageEncoding>
                <security  authenticationMode="SecureConversation">
                    <localClientSettings maxClockSkew="00:10:00"/>
                    <localServiceSettings maxClockSkew="00:10:00"/>
                    <secureConversationBootstrap authenticationMode="UserNameOverTransport">
                        <localClientSettings maxClockSkew="00:10:00"/>
                        <localServiceSettings maxClockSkew="00:10:00"/>
                    </secureConversationBootstrap>
                </security>
                <httpsTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647"/>
            </binding>
        </customBinding>
    </bindings>
</system.serviceModel>
<startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>

我错过了什么?有人遇到过这个问题吗?我没有发现很多人面临这种​​情况。

提前致谢

佩德罗

1 个答案:

答案 0 :(得分:0)

您需要明确设置新绑定:

http://msdn.microsoft.com/en-us/library/aa738468.aspx

HTH