Note that there are some explanatory texts on larger screens.

plurals
  1. POProtecting my REST service, which I will use on the client side, from others to use
    primarykey
    data
    text
    <p>Let's assume that I have created my REST service smoothly and I am returning json results.</p> <p>I also implemented API key for my users to communicate for my service.</p> <p>Then Company A started using my service and I gave them an API key.</p> <p>Then they created an <code>HttpHandler</code> for bridge <em>(I am not sure what is the term here)</em> in order not to expose API key <em>(I am also not sure it is the right way)</em>.</p> <p>For example, lets assume that my service url is as follows : </p> <blockquote> <p>www.myservice.com/service?apikey={key_comes_here}</p> </blockquote> <p>Company A is using this service from client side like below : </p> <blockquote> <p>www.companyA.com/services/service1.ashx</p> </blockquote> <p>Then they start using it on the client side.</p> <p>Company A protected the api key here. That's fine. </p> <p>But there is another problem here. Somebody else can still grab <code>www.companyA.com/services/service1.ashx</code> url and starts using my service. </p> <p>What is the way of preventing others from doing that?</p> <p>For the record, I am using WCF Web API in order to create my REST services.</p> <p><strong>UPDATE :</strong> </p> <p>Company A's HttpHandler (second link) only looks at the host header in order to see if it is coming from <code>www.companyA.com</code> or not. but in can be faked easily I guess.</p> <p><strong>UPDATE 2 :</strong></p> <p>Is there any known way of implementing a Token for the url. For example, lets say that <code>www.companyA.com/services/service1.ashx</code> will carry a querystring parameter representing a TOKEN in order for HttpHandler to check if the request is the right one.</p> <p>But there are many things here to think about I guess.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload