Sign the marker (I recommend using HMAC, at least with SHA-1). This site provides sample code for ASP.NET; I do not use .NET, so I can not check this code.
Provide the client with the HMAC token. Ask the customer to send him back to the web service with each request.
In the web service, simply verify the HMAC signature.
If your token never changes, some attackers can observe it in the client code and copy it. You can get around this by making the marker a timestamp and allowing tokens only if they are within a certain period of time, or by binding the marker to a specific user in any way.
As a safety measure, referents are not enough; they can be deleted by proxies or tampered with by malicious clients.
source
share