Groups | Blog | Home
all groups > dotnet web services enhancements > june 2004 >

dotnet web services enhancements : how to remove the timestamp in WSE2


Byron Kim
6/25/2004 9:33:07 AM
Timestamp filter was gone. Timestamp header is a part of Security header, so
it is handled by SecurityFilter.
So if you have clock synchronization problem, you can increase the
timeToleranceInSeconds. Because you seem not care about the clock difference
between sender and receiver.
thanks

Byron KIM


[quoted text, click to view]
hi,
i'm trying to do a completely time-insensitive implementation of username
tokens with WSE2.
i've had real difficulty trying to remove the timestamp filter. i got a tip
about how to do it in WSE1:
SoapInputFilterCollection defaultInputFilters =
WebServicesConfiguration.FilterConfiguration.InputFilters;
defaultInputFilters.Remove(typeof(TimestampInputFilter));
but this doesn't seem to translate well to WSE2.

so i need to remove timestamp checking because some of the client clocks may
be ahead of the server by a large amount of time and this causes an
exception: "At least one timestamp has expired". my web.config and
policyCache.config files are below.
thanks for any advice
tim


************************************************
<microsoft.web.services2>

<messaging>

<maxRequestLength>256000</maxRequestLength>

</messaging>

<diagnostics>

<detailedErrors enabled="false" />

</diagnostics>

<security>

<x509 allowTestRoot="true" allowRevocationUrlRetrieval="false"
verifyTrust="true" />

<securityTokenManager type="CustomUsernameTokenManager, WebForms"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecuri
ty-secext-1.0.xsd"

qname="wsse:UsernameToken" />

<defaultTtlInSeconds>60</defaultTtlInSeconds>

<timeToleranceInSeconds>120</timeToleranceInSeconds>

</security>

<policy>

<cache name="policyCache.config" />

</policy>

</microsoft.web.services2>

************************************************

policyCache.config file:
<?xml version="1.0"?>

<policyDocument xmlns:wse="http://schemas.microsoft.com/wse/2003/06/Policy"
xmlns="http://schemas.microsoft.com/wse/2003/06/Policy">

<mappings xmlns:wse="http://schemas.microsoft.com/wse/2003/06/Policy">

<endpoint uri="http://shuttle/appUpdater.asmx">

<defaultOperation>

<request policy="" />

<response policy="" />

<fault policy="" />

</defaultOperation>

</endpoint>

<defaultEndpoint>

<defaultOperation>

<request policy="#username-token-signed" />

<response policy="" />

<fault policy="" />

</defaultOperation>

</defaultEndpoint>

</mappings>

<policies
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurit
y-utility-1.0.xsd">

<wsp:Policy wsu:Id="username-token-signed"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
xmlns:wssp="http://schemas.xmlsoap.org/ws/2002/12/secext">

<wsp:MessagePredicate wsp:Usage="wsp:Required"
Dialect="http://schemas.xmlsoap.org/2002/12/wsse#part">

wsp:Body() wsp:Header(wsa:To) wsp:Header(wsa:Action)
wsp:Header(wsa:MessageID)

</wsp:MessagePredicate>

<wssp:Integrity wsp:Usage="wsp:Required">

<wssp:TokenInfo>

<SecurityToken xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext">

<wssp:TokenType>http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-user
name-token-profile-1.0#UsernameToken</wssp:TokenType>

<wssp:Claims>

<wssp:UsePassword wsp:Usage="wsp:Required" />

</wssp:Claims>

</SecurityToken>

</wssp:TokenInfo>

<wssp:MessageParts Dialect="http://schemas.xmlsoap.org/2002/12/wsse#part">

wsp:Body() wsp:Header(wsa:Action) wsp:Header(wsa:FaultTo)
wsp:Header(wsa:From) wsp:Header(wsa:MessageID) wsp:Header(wsa:RelatesTo)
wsp:Header(wsa:ReplyTo) wsp:Header(wsa:To)

</wssp:MessageParts>

</wssp:Integrity>

</wsp:Policy>

</policies>

</policyDocument>



\\ email: tim at mackey dot ie //
\\ blog: http://tim.mackey.ie //
67d0ebfec70e8db3

Tim Mackey
6/25/2004 4:25:57 PM
hi,=20
i'm trying to do a completely time-insensitive implementation of =
username tokens with WSE2.=20
i've had real difficulty trying to remove the timestamp filter. i got a =
tip about how to do it in WSE1:
SoapInputFilterCollection defaultInputFilters =3D
WebServicesConfiguration.FilterConfiguration.InputFilters;
defaultInputFilters.Remove(typeof(TimestampInputFilter));
but this doesn't seem to translate well to WSE2.=20

so i need to remove timestamp checking because some of the client clocks =
may be ahead of the server by a large amount of time and this causes an =
exception: "At least one timestamp has expired". my web.config and =
policyCache.config files are below.
thanks for any advice
tim


************************************************
<microsoft.web.services2>

<messaging>

<maxRequestLength>256000</maxRequestLength>

</messaging>

<diagnostics>

<detailedErrors enabled=3D"false" />

</diagnostics>

<security>

<x509 allowTestRoot=3D"true" allowRevocationUrlRetrieval=3D"false" =
verifyTrust=3D"true" />

<securityTokenManager type=3D"CustomUsernameTokenManager, WebForms" =
xmlns:wsse=3D"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wss=
ecurity-secext-1.0.xsd"

qname=3D"wsse:UsernameToken" />

<defaultTtlInSeconds>60</defaultTtlInSeconds>

<timeToleranceInSeconds>120</timeToleranceInSeconds>

</security>

<policy>

<cache name=3D"policyCache.config" />

</policy>

</microsoft.web.services2>

************************************************

policyCache.config file:
<?xml version=3D"1.0"?>

<policyDocument =
xmlns:wse=3D"http://schemas.microsoft.com/wse/2003/06/Policy" =
xmlns=3D"http://schemas.microsoft.com/wse/2003/06/Policy">

<mappings xmlns:wse=3D"http://schemas.microsoft.com/wse/2003/06/Policy">

<endpoint uri=3D"http://shuttle/appUpdater.asmx">

<defaultOperation>

<request policy=3D"" />

<response policy=3D"" />

<fault policy=3D"" />

</defaultOperation>

</endpoint>

<defaultEndpoint>

<defaultOperation>

<request policy=3D"#username-token-signed" />

<response policy=3D"" />

<fault policy=3D"" />

</defaultOperation>

</defaultEndpoint>

</mappings>

<policies =
xmlns:wsu=3D"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wsse=
curity-utility-1.0.xsd">

<wsp:Policy wsu:Id=3D"username-token-signed" =
xmlns:wsp=3D"http://schemas.xmlsoap.org/ws/2002/12/policy" =
xmlns:wsa=3D"http://schemas.xmlsoap.org/ws/2004/03/addressing" =
xmlns:wssp=3D"http://schemas.xmlsoap.org/ws/2002/12/secext">

<wsp:MessagePredicate wsp:Usage=3D"wsp:Required" =
Dialect=3D"http://schemas.xmlsoap.org/2002/12/wsse#part">

wsp:Body() wsp:Header(wsa:To) wsp:Header(wsa:Action) =
wsp:Header(wsa:MessageID)

</wsp:MessagePredicate>

<wssp:Integrity wsp:Usage=3D"wsp:Required">

<wssp:TokenInfo>

<SecurityToken xmlns=3D"http://schemas.xmlsoap.org/ws/2002/12/secext">

<wssp:TokenType>http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-u=
sername-token-profile-1.0#UsernameToken</wssp:TokenType>

<wssp:Claims>

<wssp:UsePassword wsp:Usage=3D"wsp:Required" />

</wssp:Claims>

</SecurityToken>

</wssp:TokenInfo>

<wssp:MessageParts =
Dialect=3D"http://schemas.xmlsoap.org/2002/12/wsse#part">

wsp:Body() wsp:Header(wsa:Action) wsp:Header(wsa:FaultTo) =
wsp:Header(wsa:From) wsp:Header(wsa:MessageID) wsp:Header(wsa:RelatesTo) =
wsp:Header(wsa:ReplyTo) wsp:Header(wsa:To)

</wssp:MessageParts>

</wssp:Integrity>

</wsp:Policy>

</policies>

</policyDocument>



\\ email: tim at mackey dot ie //
\\ blog: http://tim.mackey.ie //
Jocelyn Duhaylungsod
8/23/2004 7:39:03 AM
I have the same clock synchronization problem in my distributed application.
I am wondering if I need to put the time zone difference into consideration
when I set the timeToleranceInSeconds?
(My clients are in different time zone. They all access the web service in
the east coast.)

Also, I come across this scenario from the WSE 2.0 Service Pack 1 Readme
document under the Known Issues section. It said I could set the lifetime of
the issued token without sending in the creation time. By doing that, the
timing related errors would be avoided.


[quoted text, click to view]
Lucien
8/23/2004 9:52:51 AM
No different timezone does not require you to adjust any settings since WSE
Timestamps are stored in the UTC format s you shouldn't get any issues with
different timezones.

See WSE settings tool (Visual Studio). You can set the default TTL. But as
mentioned you can also increase the timeToleranceInSeconds to adjust for
machine time differences.

"Jocelyn Duhaylungsod" <Jocelyn Duhaylungsod@discussions.microsoft.com>
[quoted text, click to view]

AddThis Social Bookmark Button