Brief question: I've a Web API Service in .NET, and a Site made only with HTML and AngularJS.
How can authorize to my service ONLY my web?
I'm looking for a secure answer to a problem that seems to be common but is not. I read a lot of answers, ideas and every kind of things in the late days, but I couldn't find the solution.
Let's suppose I've a Web Api Service (the lastest one) from MS. So I have to application that need consumes it. Let's define two scenarios.
Scenario 1:
In the same IIS, I've an ASP.NET MVC 3/4 with the particularity that all MVC work is on the client side, made by AngularJS, so the App points directly from JavaScript to the Web Api Service.
Scenario 2:
I've a third party application that points directly to the Web Api Service, and is locate in other network/site/anything but related.
So, my question is:
How can authenticate both systems, in order to the Web Api Service gives access to both system (I don't care if is the same way or not), and not give access for example to a guy with a REST client, and logged to the site with user/pass authorization? I hope these both examples gave the idea of the point what I'm interested.
Please comment below anything you need to improve this question in a better way!
By the way, no, obfuscation can not be used. I thought in something like a refreshing token but I can't figure it.