Solved

How to secure a WCF JSON service

Posted on 2014-01-21
5
427 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
ID: 39796712
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
ID: 39796718
I want to prevent anyone from calling it.
Only validated users , after logging in.
0
 
LVL 82

Expert Comment

by:leakim971
ID: 39796728
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
ID: 39796764
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
ID: 39796775
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

810 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