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

  • Home
  • SEARCH
  • 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 426097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:26:44+00:00 2026-05-12T19:26:44+00:00

HTTP Referer is the way I’m doing it at the moment. As everyone who’s

  • 0

HTTP Referer is the way I’m doing it at the moment. As everyone who’s used this method knows it is not 100% accurate as the Referer header is optional and maybe fiddled with.

Looking at how-to-ensure-access-to-my-web-service-from-my-code-only I’m still unsure of how to go about this in a minimal way.

The situation:

Advertising on someone else’s site. Using an iFrame so I can change content/function at will. I pay $x.xx for every time an action is completed. Therefore I need to ensure that the action is being completed from where I said it is allowed to be completed from.

What I’m trying to prevent:

some other webmaster coming along going – “hey that’s a nice tool, let me put that on my site”
So as i said at the top, what i do atm is if the referer doesn’t match I redirect to a page that has the same tool however whatever actions are preformed on that page they don’t cost me any money.

While trying to prevent the above, allow the following:

I don’t mind if the webmaster/site owner I’m paying cash to for “actions complete” puts the code on other sites – obviously this is a good thing. Lots more coverage, the site owner gets more cash & i get more actions completed, which generates me more cash.

Question

What can I get the other party to do so I know all the requests coming into my web page are from the other party I have an agreement with and not some random.

Thanks 🙂

info re app

other parties website has an iFrame. iFrame displays a html/js/php page of mine that sits on one of my domains. This page uses ajax requests to interact with the actual webservice that is a ruby/sinatra app. I have lots of different pages that fit into the look and feel of the other parties website.


So I’m thinking some sort of chatter between the other parties server and my server would be a good idea. Then the result of this chatter would be somehow present during the iFrame request.

However I’m not sure if the other party would be able to set a cookie for the domain being served in the iFrame – in fact I’m pretty sure it can’t.

Now to get around that limitation I could have a script included as part of the iFrame on the page that could set a cookie.

Ok the above ideas summarised:

  • OtherParty server sends a request to my server gets a response.
  • renders the page with that response as a param to a <script src=”…?param”></script>
  • my script sets a cookie
  • as script is before iFrame, script is loaded first
  • iFrame loads with page as a cookie has been set on that domain cookie set before is sent as well
  • bingo, request verified legit

Does this sound ok?

btw my tool that I want action completed on only works if JS is enabled 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-05-12T19:26:44+00:00Added an answer on May 12, 2026 at 7:26 pm

    If you really want to secure who can load your iframe, then one way to do this is via 2-legged OAuth (i.e. have your trusted partner “sign” the iframe GET request). Then your server can grant access based on a cryptographically valid signature and a known signing party. You’ll want to enforce relatively short valid lifetimes for the signed requests to prevent someone else from just copying them and embedding them in their own site.

    This also gives you the advantage of just having to do an initial, offline key exchange without having your partner making extra server requests of you ahead of the iframe insertion.

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

Sidebar

Ask A Question

Stats

  • Questions 260k
  • Answers 260k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I can't reproduce this. Sounds like an issue with the… May 13, 2026 at 11:21 am
  • Editorial Team
    Editorial Team added an answer As others have noted, .jspf files are JSP fragments. They're… May 13, 2026 at 11:21 am
  • Editorial Team
    Editorial Team added an answer A pandigital number doesn't needs to contain all numbers from… May 13, 2026 at 11:21 am

Related Questions

HTTP Referer is the way I'm doing it at the moment. As everyone who's
I mod_rewrite my pages very similar to how SO does it. I have www.example.com/users/login/
I was wondering if there was a way to send a referer with a
I have an ASP.Net HTTPHandler that gets POSTed from a ColdFusion web page whose
Say you have a legacy website running on an old code-base that offers certain

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.