Solved

How to secure a WCF JSON service

Posted on 2014-01-21
5
425 Views
Last Modified: 2014-01-24
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.
0
Comment
Question by:JElster
  • 3
  • 2
5 Comments
 
LVL 82

Expert Comment

by:leakim971
Comment Utility
If anyone in the world can't call it using Ajax or any method, what is the purpose?
0
 
LVL 1

Author Comment

by:JElster
Comment Utility
I want to prevent anyone from calling it.
Only validated users , after logging in.
0
 
LVL 82

Expert Comment

by:leakim971
Comment Utility
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
 
LVL 1

Author Comment

by:JElster
Comment Utility
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
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
Comment Utility
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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now