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 8937509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:25:44+00:00 2026-06-15T10:25:44+00:00

This question is similar to this one: Developing API – how to make it

  • 0

This question is similar to this one:

Developing API – how to make it secured?

What I want is to develop a jQuery based query against a REST api on my server to retrieve some data for display on a web page.

I want the authorized user of the web page and jQuery to be able to access this data, but don’t want others to be able to copy that jQuery and put it on their site to access this data in any way. And to be clear, this is all happening client side in the browser – without any server side code involved…

What is the correct strategy to accomplish this if it is even possible?

I don’t want the end user viewing the web page to have to know anything about any of this going on in their browser…

Thanks!

  • 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-15T10:25:45+00:00Added an answer on June 15, 2026 at 10:25 am

    If you don’t require your end-user to do any sort of authentication into your site so you can’t use that as an auth method and you want your webpage to be able to use the REST API without any other intervention, then there is no foolproof way to secure your REST API. If you want the data in an unauthenticated browser, then anyone can retrieve that data.

    Keep in mind also that they could always just run your web page and parse the data out of your web page too so, if no authentication is required to use this web page, the data is already available to the general public. You can’t truly secure it without requiring authentication.

    There are some things you can try to make it more difficult for people to use your REST API, though none are foolproof. These are only obstacles, not security.

    1. You can put an expiring token into your web page, include that in the web request and then verify it’s an unexpired token in the REST API. This prevents someone from just using your REST API directly from another browser page (they won’t have a legal token), but doesn’t prevent a server from first fetching the host page, retrieving the token and then using it to access the API.

    2. You can try checking the referrer and only fulfill web requests that say that are coming from your domain. This is also not foolproof since the referrer can be spoofed, but it is an obstacle.

    3. You can make the data response obscure so that it’s not immediately obvious how to interpret the data that is returned (scrambled, encrypted, etc…). Again, this is just an obstacle that won’t prevent a determined hacker from reverse engineering how your own code interprets the response, but it is again more work that gets in the way of casual users of your REST API.

    What a lot of REST APIs do is require an accessKey be used with every API call. Your web page would have an accessKey built in. Any outside developer that wishes to use your API (with your permission) applies for an accessKey and you grant it to them (if you want them to be able to use your API). Your server then only allows access requests from approved accessKeys. If you find that there is some rogue use of an accessKey, you can shut down use of that accessKey at your server. If the accesskey in your own web page is being used by someone against your wishes, then you can change the accessKey you put in your own web page and revoke privileges for the previous accessKey. Obviously, some rogue developer could keep grabbing the accessKey out of your own web page, but they would have to do that regularly in order to regularly use your API. Again, it’s just an obstacle that can be surmounted by a determined/knowledgeable developer, but it’s about the best you can do for data that is already available to the public.

    FYI, here’s another similar discussion: How to restrict JSON access?

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

Sidebar

Related Questions

my question is similar to this one , but I don't want to use
My question is very similar to this one . The application I'm developing is
This question is similar to this one, but with an extra wrinkle: Auto-removing all
This question is similar to this one How do I add options to a
This question is similar to this other one , with the difference that the
This question is similar in concept to this one , except I see I
The question is similar to this question. However, this one is about exceptions, not
I'm looking for an answer to a question similar to this one: protect users'
This is a similar question to this one . I would like to convert
This is a similar question to this one here . Given a list of

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.