Securing aspx page method or webservices method calls through jQuery
How do I secure my aspx page method or webservices method call through jQuery?
I found some answers on Google but I'm still not sure about the details.
What I found:
I would secure it by making sure the request is from the same session that the page is served in.
You can do this by issuing a signed cookie when you return the page that contains that javascript that is going to callback into your web service. When your page makes the ajax call, it will include this signed cookie, which you can validate within your web method before returning any results.
To prevent cookie spoofin开发者_StackOverflow中文版g, store a unique tokenID in your session and make that tokenID part of your cookie. If the tokenID's do not match, don't process the web method (just return an error).
- How do I make sure that request is from the same session?
- How do I include a signed cookie when page makes the ajax call?
- What is a signed cookie?
精彩评论