I understand that it must be present if used with hashed password. My
question is how do I prevent the default of sending it!
I have tried the replayDetection setting server side to not require it, sent
a message without the nonce detail and still got an "invalid token". As part
of this I also commented out any detail in the config of my UsernameToken
Manager implementation. I assume this is correct.
> I understand that it must be present if used with hashed password. My
> question is how do I prevent the default of sending it!
> I have tried the replayDetection setting server side to not require it, sent
> a message without the nonce detail and still got an "invalid token". As part
> of this I also commented out any detail in the config of my UsernameToken
> Manager implementation. I assume this is correct.
There is no way to prevent WSE sending the Nonce; it's defined in the
WSS specification, other implementations ought to be able to accept it,
particularly since it's not a complex construct like some others in WSS.
Commenting out your UsernameTokenManager means that you'll be running
with the WSE default implementation, this expects to process a
UsernameToken that contains a plain text password that can be
authenticated against a Windows Domain. If your token doesn't include
the plain text password (for example), then it will be rejected by the
server. If you don't want this default UsernameTokenManager you must
override it with your own implementation (there's an example in the
product samples).
There are several messages associated with invalid tokens, including
ones like "The security token could not be authenticated or authorized".
If you're getting this fault, it's likely because the token either
doesn't have the password or the password cannot be validated against
the domain. If this isn't the fault that you're getting, perhaps you can
turn on detailedErrors in the config and post details of the fault to
help me understand where the failure occurs.

Signature
This posting is provided "AS IS", with no warranties, and confers no rights.
Bakunin - 29 Sep 2004 10:25 GMT
I have the exact same issue.
I have set the replaydetection setting in my config file to false, and the
constructor of my usernamemanager implementation sets everything to base
implementation passing in XMLNode. I only override the ValidateToken method.
public myUsernameTokenManager(XMLNodeList nodes) : base(nodes)
protected override string validateToken(usernametoken p_token)
However I get an error stating:
The token must contain both a nonce and timestamp ....
> > I understand that it must be present if used with hashed password. My
> > question is how do I prevent the default of sending it!
[quoted text clipped - 23 lines]
> turn on detailedErrors in the config and post details of the fault to
> help me understand where the failure occurs.
Hervey Wilson [MSFT] - 29 Sep 2004 19:42 GMT
> I have the exact same issue.
>
[quoted text clipped - 8 lines]
>
> The token must contain both a nonce and timestamp ....
The only place this exact error is issued is if replayDetection is
enabled for the UsernameToken and the incoming token does not contain a
Nonce and Created. Of course, if you have used the Hashed Password
option, or you have signed with the UsernameToken, then the Nonce and
Created will be required since they are used for key generation.
The replayDetection setting is read from configuration, if you have a
custom UsernameTokenManager you must implement the constructor that
accepts the configuration node list (as you appear to have done above):
public MyUsernameTokenManager(XmlNodeList configData) : base(configData)
{
...
}
The configuration entry in your app.config / web.config, for the default
UsernameTokenManager, would be:
<microsoft.web.services2>
<security>
<securityTokenManager
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
qname="wsse:UsernameToken"
<replayDection enabled="false" windowInSeconds="300" />
</securityTokenManager>
</security>
</microsoft.web.services2>
If you want a custom UsernameTokenManager, you should also specify the
type="" attribute on the <securityTokenManager> element.
I hope this helps.
--
This posting is provided "AS IS", with no warranties, and confers no rights.
John Jenkins - 29 Sep 2004 20:12 GMT
I set up a new project from scratch, and implemented your suggestion. It
works.
1. I did a AuthenticateToken override
2. Set the replayDetection to false
3. Sumitted messages both from my web service client and SOAP Tool.
4. All worked.
I will try to add this to my current solution.
Many thanks for the help, it is greatly appreciated.
> > I understand that it must be present if used with hashed password. My
> > question is how do I prevent the default of sending it!
[quoted text clipped - 23 lines]
> turn on detailedErrors in the config and post details of the fault to
> help me understand where the failure occurs.