Nonce, a randomly generated token
Nonce is a randomly generated, cryptographic token that is used to prevent replay attacks. Although nonce can be inserted anywhere in the SOAP message, it is typically inserted in the UsernameToken element.
Without nonce, when a user name token is passed from one machine to another machine using a nonsecure transport, such as HTTP, the token might be intercepted and used in a replay attack. The same password might be reused when the user name token is transmitted between the client and the server, which leaves it vulnerable to attack. The user name token can be stolen even if you use XML digital signature and XML encryption.
To help eliminate these replay attacks, the <wsse:Nonce> and <wsu:Created> elements are generated within the <wsse:UsernameToken> element and used to validate the message. The server checks the freshness of the message by verifying that the difference between the nonce creation time, which is specified by the <wsu:Created> element, and the current time falls within a specified time period. Also, the server checks a cache of used nonces to verify that the user name token in the received SOAP message has not been processed within the specified time period. These two features are used to lessen the chance that a user name token is used for a replay attack.
To add nonce for the user name token, you can specify it in the token generator for the user name token. When the token generator for the user name token is specified, you can select the Add nonce option if you want to include nonce in the user name token.
Related concepts
Distributed nonce cache
Web services security enhancements
Related tasks
Distributing nonce caching to servers in a cluster
Related Reference
Security considerations for Web services