Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is it possible to stop requests (POSTs) from different origins on Google App Engine? I understand that IP spoofing is "easy", is there another solution, maybe sessions? Suggestions are welcome.

share|improve this question

2 Answers 2

Not entirely sure from your wording if this is the answer you're after, but you can get the referrer page using the following:

    #Get referring page
    referer = self.request.environ['HTTP_REFERER'] \
              if 'HTTP_REFERER' in self.request.environ else  None

You can then use regex to decided whether to process the request further. Source: http://blog.andrewhays.net/how-to-get-the-referer-url-from-google-appeng

share|improve this answer

Assuming this is PHP, just check $_SERVER['REMOTE_ADDR'] for the IP/$_SERVER['REMOTE_HOST'] for host they are connecting from. For your specific question though, I would reccomend creating a SESSION variable for when data is submitted it can be checked by the server to verify its source. You can read more on it here.

Hope this helps and DFTBA. :)

share|improve this answer
    
Sorry to give you a down vote. It's not PHP, it's running on Google's App Engine so it would be either Python or Java (Python in this case). Furthermore I specified that spoofing an IP address is easy, so REMOTE_ADDR isn't a safe way to determine where are user is coming from: stackoverflow.com/questions/4773969/… –  Ahmed Nuaman Jun 7 '12 at 19:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.