Martin Ongtangco
Martin Ongtangco

Reputation: 23515

How do you protect Web Services when using it as JSON via Jquery?

I currently use asmx for Json transactions using Jquery.

How do I protect it from being accessed across other websites and make it exclusive only through my domain?

Upvotes: 2

Views: 391

Answers (1)

cletus
cletus

Reputation: 625077

Ensure the requestor has:

  • HTTP_REFERER set to your site; and
  • a valid cookie for your site.

This will prevent the behaviour that is most akin to hotlinking. However if a site uses an HTTP library to use your Web service and it's public there's not a lot you can do beyond IP throttling and similar techniques.

Upvotes: 3

Related Questions