Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7900283
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:55:54+00:00 2026-06-03T08:55:54+00:00

I have an ASP.Net MVC3 web application written in C#. I have one ActionResult

  • 0

I have an ASP.Net MVC3 web application written in C#.

I have one ActionResult that has been designed to return a Json result so that it can be called asynchronously by a webpage using JavaScript. The action is basically as follows:

public ActionResult FindSomething(string search)
{
   var result = GetSearchResult(search);

   return Json(new { @Result = result }, JsonRequestBehavior.AllowGet);
}

Then in one of the web pages I have some JavaScript (using JQuery) to get the data.

What I want to try and do however is to restrict access to this FindSomething Action so that only my website code can get access to the result. As it stands anybody could call this Action from a web browser.

Any ideas on some options for me to get this done?

It should be noted that there will be no login to this website so no authentication can be done that way. And I do not want to have anything in the html source code relating to a password approach.


Why I want this:

The FindSomething method actually calls a third party service, which is paid for using credits. So in effect, the number of calls, the more it costs.

My concern is, if someone knows about this URL and wants to use the same service then they could query it by our URL and avoid the charge.

I am not sure if this 3rd party service has even consider this, they offer a couple of ways to interact with the service. One through a web service which I can call via server code (which I am doing) and one through some inline javascript references – the latter of which requires hard-coded license key in the html source :S

…it may be worth me hitting them up for an answer, but regardless of how I get around this flaw in the service, it still makes for an interesting question here on SO

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T08:55:55+00:00Added an answer on June 3, 2026 at 8:55 am

    I am afraid that there’s no reliable way to achieve that given your constraints. You could make it difficult by using for example anti forgery tokens but not 100% bullet-proof. Don’t forget that not only browsers can send HTTP requests. Anyone can forge an HTTP request and send it to your server.

    The way this is done with non GUI APIs is that public keys are given to clients and the way this is done with GUI applications such as web sites is by giving passwords to your users.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working on ASP.net MVC3 Web application using MSSQL 2008 R2 for
This is about asp.net mvc3 web application. We have used Object cache to store
I am writing a web application on Asp.Net MVC 3. Assume that we have
I have a ASP.NET MVC3 application that handles time-consuming processes (copying a large file
I have a web-application written on ASP.NET MVC 3. On client side I used
I have a web application written in ASP.NET MVC 3 . This application have
I have a web application written in ASP .NET MVC 3. I'm using ACS
We have a web application written in ASP.NET for .NET 3.5, using standard web
I have built an ASP.NET MVC 3 web application (with exlusively Razor/cshtml pages) that
I have Ninject working nicely in an ASP.NET MVC3 web application. I'd like to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.