How can I ensure that information isn’t returned from a webmethod or mvc action by just anyone calling it from Jquery/Ajax call/HTTP post get (you get the idea).
Previously I would have used session variables or the view state to do this on every call, is this still possible. Can anyone point me to any good demos around making these calls secure, I’ve seen a few but they are easy to spoof or work around.
Thanks!
You can use the
AuthorizeAttributeas an action filter to filter access to your controllers. You can just add this attribute to the controllers you want to limit the access to. I think the msdn has a good example for this:http://msdn.microsoft.com/en-us/library/dd381413(v=vs.90).aspx