473,382 Members | 1,376 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

How to not allow external calls to .aspx page?

I have a .aspx page that creates proprietary images (return type is image). Normally, calls to this .aspx page come from our own pages. I don't want someone to just type the URL for the .aspx image page (with modified query parameters)...I only want the .aspx page to work if it was called (embedded) from our own page.

How can this be done? Can it be done without session variables? Is there an HTTP header or server variable that can be checked?
Nov 18 '05 #1
3 1372
There is an HTTP Requestor or some such thing in the Request object
that should be able to determine if the request came from where you
want it to. If not, show a picture of something that they can get in
trouble for viewing, but you cant get in trouble for showing :)
On Fri, 16 Jan 2004 16:36:05 -0800, "Amil"
<an*******@discussions.microsoft.com> wrote:
I have a .aspx page that creates proprietary images (return type is image). Normally, calls to this .aspx page come from our own pages. I don't want someone to just type the URL for the .aspx image page (with modified query parameters)...I only want the .aspx page to work if it was called (embedded) from our own page.

How can this be done? Can it be done without session variables? Is there an HTTP header or server variable that can be checked?


Nov 18 '05 #2
You could check the http_refererer servervariable to see where the request
came from, and if it's invalid, show an alternative image (i.e. access
forbidden). I've implemented something similar in the past with limited
success. The http_referer seemed to intermittently stop working for me,
causing the "access forbidden" image to show even when the image was being
viewed in the correct page. However, this may have had something to do with
my company's firewall settings...

Regards,

Mun

--
Munsifali Rashid
http://www.munsplace.com/

"Amil" <an*******@discussions.microsoft.com> wrote in message
news:8A**********************************@microsof t.com...
I have a .aspx page that creates proprietary images (return type is image). Normally, calls to this .aspx page come from our own pages. I
don't want someone to just type the URL for the .aspx image page (with
modified query parameters)...I only want the .aspx page to work if it was
called (embedded) from our own page.
How can this be done? Can it be done without session variables? Is there

an HTTP header or server variable that can be checked?
Nov 18 '05 #3
Here is what I ended up doing...
I use the Request.UrlReferrer.AbsolutePath to make sure the request came
from my own server. Normally, this path starts with something like
http://www.mydomain.com/.... I think you can also use the Host member to
verify the host requesting it came from itself.

Amil

"Amil" <an*******@discussions.microsoft.com> wrote in message
news:8A**********************************@microsof t.com...
I have a .aspx page that creates proprietary images (return type is image). Normally, calls to this .aspx page come from our own pages. I
don't want someone to just type the URL for the .aspx image page (with
modified query parameters)...I only want the .aspx page to work if it was
called (embedded) from our own page.
How can this be done? Can it be done without session variables? Is there

an HTTP header or server variable that can be checked?
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Dariusz | last post by:
I currently have a layout that is part written in SHTML - in other words, it gets processed by the web server to execute any calls for PHP or Perl code as well as the html (and external imported...
6
by: wASP | last post by:
Hello everyone, I'm new to C# and ASP.NET, so pardon my stupidity on this one. I'm having a problem with referencing methods/functions external to a class member function. My code is as...
3
by: Trapulo | last post by:
I've a datarepeater that loads custom external templates with loadtemplate and bind data to them. All ok. Now I need to localize some text labels, but I don't know how can I change this data. If I...
24
by: ej1002 | last post by:
Hi I have developed a Windows Application(C# Windows Form) which will get the IFrame Source of the page it is navigating using Webbrowser Control. Now I want do this in ASP.Net web application(C#...
2
by: Matt Weaver | last post by:
I'm converting an application from VB6 to VB.NET. In the application, a page calls an external javascript file which is generated in ASP. I'm trying to do this in an ASPX page, but I can't figure...
0
by: furiousmojo | last post by:
Okay, so I thought this would be easy, but it's not turning out that way. Let's see how good you guys are! :-) I have a windows authentication-based Intranet application. An excerpt from the...
5
by: althafexcel | last post by:
hi everyone Im trying to include an external js in my aspx page under the head tag, it doesn't load or it displays an object expected error whenver the function from the .js is called. Actually...
5
by: =?Utf-8?B?TWFydHluIEZld3RyZWxs?= | last post by:
From the amount of articles about this one I’m sure this gets asked a lot, but I haven’t yet found a succinct article which explains what is required in its entirety. I work using Visual...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.