Solved

How to secure a WCF JSON service

Posted on 2014-01-21
5
431 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Prevent a display:none image from downloading on page load 5 87
email validation 9 64
TypeError jquery issues with site - CSS conflicts 3 46
sort Multi-dimensional array 6 45
DOM Attributes and Properties treatment with jQuery 1.6 by Ivo Stoykov jQuery (http://jquery.com/) 1.6 introduces .prop() (http://api.jquery.com/prop/) and .removeProp() (http://api.jquery.com/removeProp/) methods which allow modifying or removi…
Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
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…

739 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