4
我想設置我的WCF服務的maxClockSkew高於5分鐘(默認),但我沒有成功。當我想將它與authenticationMode =「UserNameOverTransport」一起設置時,看起來有些問題。我需要這個,因爲我的服務器在https下運行,我將使用自定義身份驗證提供程序對用戶進行身份驗證。有一個在服務器初始化沒有錯誤,但該值不爲5分鐘(00:05:00)改變......我總是從客戶端惱人的消息說maxClockSkew沒有得到高於5分鐘?!(即使我明確設置)
安全時間戳無效因爲它的創建時間('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>
我在想什麼?有沒有人遇到過這個問題?我沒有發現很多人面臨這種情況。
在此先感謝
佩德羅