How to secure a WCF JSON service

I created a basic WCF service that returns JSON.
How can I secure it so it can't be called by anyone?
I know I can use SSL to encrypt the JSON.
But how do I prevent anyone in the world from calling via JQUERY.
LVL 1
JElsterAsked:
Who is Participating?
 
leakim971Connect With a Mentor PluritechnicianCommented:
if the user just type the URL in the browser, the server check if he's not validated/loggedin/connected and provide data or not.

if the user is validated/connected/loggedin he will always be able to load the data.
using POST method, prevent someone to get data by just typing URL in a browser but there's lot of workaround
0
 
leakim971PluritechnicianCommented:
If anyone in the world can't call it using Ajax or any method, what is the purpose?
0
 
JElsterAuthor Commented:
I want to prevent anyone from calling it.
Only validated users , after logging in.
0
 
leakim971PluritechnicianCommented:
so once user is validated, you create a session variable and in your web services, you check is the user is connected using the session variable
0
 
JElsterAuthor Commented:
I'm not calling it from ASP.Net.  
I'm calling from a plain html page with JS.
So I can create some variable - so that if they are validated and if true allow access?
What's prevented them from just entering the URL in a browser and running it?
That's my main concern.
0
All Courses

From novice to tech pro — start learning today.