Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Professional
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 22nd, 2006, 08:25 AM
Authorized User
 
Join Date: Jan 2005
Location: , , .
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default A challenge: getting domain info with ASP

Rather unusual question here, and I'm not going to explain my reasons for wanting to achieve the scenario described. It may sound strange, but it is a real request for a particular application. Hopefully, someone can help me.

I want to make a web page available on my server that is, in effect, licenced to people who wish to use it within an iframe of their own web site.

The version of the web page that an individual subscribes to will have a unique name (e.g. ejidz8ry4sv3.asp) for that subscriber.

I wish to prevent subscribers from giving the page address to other (non-subscribing) people to use.

The only way I can see that I could do this, would be to write some ASP that checks (in a database table) the unique name of the file requested against the domain from which the page-request has originated (if that is knowable?) and block the request if the domain is not the registered one. However, this is theoretical in my mind, and I do not know if this kind of thing is possible. If it is, please can you tell me how to do it, or suggest an alternative approach to protecting both me and the subscriber from mis-use?

Thanks.

Reply With Quote
  #2 (permalink)  
Old September 22nd, 2006, 08:40 AM
Authorized User
 
Join Date: Jan 2005
Location: , , .
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Need to add something.

I fear my question is not too clear.

What I think I need is a way to stop a particular web page ("Page X") on my server from being accessed by anyone, UNLESS it is accessed via a LINK from a page that resides on Page X's associated registered DOMAIN.

I have no idea if this is possible, of if the concept is garbage.

Please advise. Thanks.

Reply With Quote
  #3 (permalink)  
Old September 22nd, 2006, 08:43 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

It can be done though, I don't know if it can be done completely in ASP. In anycase the best case scenario for you would be to use REMOTE_HOST or REMOTE_ADDR variables and compare that value against a database.

Of course I make the assumption that someone hositing a website is using a static IP.

Anyway, in theory what you are tying to do isn't that difficult though not something I would go about implementing, good luck.

--Stole this from a moderator

I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
Reply With Quote
  #4 (permalink)  
Old September 22nd, 2006, 08:47 AM
Authorized User
 
Join Date: Jan 2005
Location: , , .
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Let me clarify further:

Bob has subscribed to my service. He registers his web site domain name (e.g. bob.com) with me. He puts a link on his web site to his version of "Page X" that resides on my server (e.g. www.steve777.com/wkg8dy4p5j3k.asp).

People can now access that page (www.steve777.com/wkg8dy4p5j3k.asp)
by clicking that link on Bob's site.

However, people CANNOT access that page (www.steve777.com/wkg8dy4p5j3k.asp) by typing it into their browser's address bar, or including the link on a web site with a different domain.

Is this scenario possible?

Reply With Quote
  #5 (permalink)  
Old September 22nd, 2006, 08:53 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Nothing is "impossible" however unlikely. I can think of plenty of different ways to do this, but I can also think of plenty of ways to spoof the system. Is it possible? Yes. Is there a silver bullet that will make this 100% full proof for you? No i don't think so.

--Stole this from a moderator

I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
Reply With Quote
  #6 (permalink)  
Old September 22nd, 2006, 09:09 AM
Authorized User
 
Join Date: Jan 2005
Location: , , .
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK. Thanks. Looks like this page is useful:

http://www.webenalysis.com/servervariables.asp

in particular the server variable HTTP_REFERER.

Reply With Quote
  #7 (permalink)  
Old September 22nd, 2006, 09:19 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Copy that link and then close your web browser. Paste that link into your web browser and hit enter...you will notice that the HTTP_REFERER doesn't show up this time.



--Stole this from a moderator

I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
Reply With Quote
  #8 (permalink)  
Old September 22nd, 2006, 10:54 AM
Authorized User
 
Join Date: Jan 2005
Location: , , .
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Indeed. That's exactly what I want.

Reply With Quote
  #9 (permalink)  
Old September 22nd, 2006, 11:33 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

I am not sure if HTTP_REFERER works when a page is called within an IFRAME from another domain, but good luck.

--Stole this from a moderator

I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
Reply With Quote
  #10 (permalink)  
Old September 22nd, 2006, 11:51 AM
Authorized User
 
Join Date: Jan 2005
Location: , , .
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default

My guess is that it doesn't, but I can always have a link outside the iframe that loads the required subscriber-page into the iframe. That way, the loaded page will have a referer, as required.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Same pages for sub domain from main domain vivek_inos ASP.NET 1.0 and 1.1 Professional 1 February 13th, 2007 10:15 AM
get cookie info from other domain using fsockopen kamara Pro PHP 2 September 8th, 2004 06:26 AM
ASP.NEt, creating new user on Windows 2000 Domain sstoutkc Classic ASP Components 2 April 29th, 2004 06:57 AM



All times are GMT -4. The time now is 05:05 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.