473,397 Members | 2,033 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,397 software developers and data experts.

URLs

Hi,

I've been asked to write an ASP.NET app which uses traditional hyperlinks
with querystrings for navigation e.g.
http://<site>/customers/customer.aspx?id=123

The client wants the querystrings to be encrypted, sort of like Amazon.com
does. That's fine - no problem there.

However, the client now asks if there is any way of detecting whether the
user has typed the encrypted URLs directly into their browser rather than
navigate to them through the hyperlinks on the site.

I can't use HTTP_REFERER or anything like that because the client's firewall
software (Norton Internet Security) strips those types of headers off.

Any assistance gratefully received.

Mark Rae
Nov 19 '05 #1
5 1180
What about each link on your page having a guid instead of an id? The true
ID could be stored in Cache[] and set to expire in 5 minutes. That way the
referring page would not have the real ID, and the destination page could
check that the Cache[] item exists before displaying.

Probably a crap idea, but it was at least an idea :-)

--
Pete
====
ECO Modeler, Audio compression components, DIB graphics controls,
FastStrings
http://www.droopyeyes.com

Read or write articles on just about anything
http://www.HowToDoThings.com

My blog
http://blogs.slcdug.org/petermorris/
Nov 19 '05 #2
"Peter Morris [Droopy eyes software]" <pe**@not.this.or.this.droopyeyes.com>
wrote in message news:OD**************@TK2MSFTNGP15.phx.gbl...

Peter,

Thanks for the reply.
Probably a crap idea, but it was at least an idea :-)


Crap or not, it's the only one I have currently... :-)

Mark
Nov 19 '05 #3
If you goals are simply;

+ To support Url-based state (i.e. no session state dependencies), but
+ To prevent normal users from jumping straight to a page

One possibility is;

+ Create a frameset with one 100% by 100% frame, which contains your normal
site
+ Add some js to your regular site pages that check for the existance of
the frame

This basically hides navigational hyperlinks from the user (they only see
the entry page link in the browser's url bar). If the user does a view
source and gets the page Url, or does a rt-click add to favorites, they
still won't be able to execute the Url directly without the frame.

Fairly easy for a techie to circumvent but it requires more technical
knowledge than your average user possesses. At least it offers a mild
deterrent.

You could also do more complex things like;

+ /index.aspx - the site entry page. Creates a GUID, stores it in a
session var, redirects user to /home.aspx
+ /home.aspx - the site home page. A frameset, but which retrieves the
GUID from the session var and stores it in a js-accessible location
(possibly a public var to the page, or in a js function, or as a custom
attribute to <BODY>, etc.)
+ /??? - internal site pages, the ones you're "protecting" from direct
access. Normal ASPX pages, but they include a .NET-rendered js chunk that
compares the session var GUID to the GUID in the frame. If they don't
match, or there's no frame, redirect back to /index.aspx. You could, no
doubt, implement this as a drop-in control.

You could further private-key-sign the GUID that's rendered in the frame,
and on test, verify the signature to ensure the GUID was issued by the
server. Silly, probably overkill, but I'm just throwing ideas at the
markerboard to see what sticks for you.

All the best,

/// M
"Peter Morris [Droopy eyes software]" <pe**@not.this.or.this.droopyeyes.com>
wrote in message news:OD**************@TK2MSFTNGP15.phx.gbl...
What about each link on your page having a guid instead of an id? The true ID could be stored in Cache[] and set to expire in 5 minutes. That way the referring page would not have the real ID, and the destination page could
check that the Cache[] item exists before displaying.

Probably a crap idea, but it was at least an idea :-)

--
Pete
====
ECO Modeler, Audio compression components, DIB graphics controls,
FastStrings
http://www.droopyeyes.com

Read or write articles on just about anything
http://www.HowToDoThings.com

My blog
http://blogs.slcdug.org/petermorris/

Nov 19 '05 #4
"MWells" <outbound__at_sygnal.com> wrote in message
news:ua*************@TK2MSFTNGP12.phx.gbl...
If you goals are simply;

+ To support Url-based state (i.e. no session state dependencies), but
+ To prevent normal users from jumping straight to a page
That's precisely it.
but I'm just throwing ideas at the
markerboard to see what sticks for you.


Some interesting suggestions - thanks very much.
Nov 19 '05 #5
There is another, possible cleaner approach to this problem;

Write a custom control which we'll call AuthorizedHyperlink. Functionally,
you design it so that it behaves like a combination of a LinkButton and a
Hyperlink control. It renders just like a LinkButton, complete with
postback and onclick; but it also has the attribute NavigateUrl. You design
to behave as follows;

+ Someone clicks the link
+ You get a postback event (onclick)
+ You generate a GUID (using System.Guid.ToString()).
+ You store this in a session var called, e.g. "AuthorizedHyperlink".
+ You do a Response.Redirect to the NavigateUrl with an added querystring
param, e.g. "&Auth=(the guid string)"
+ In the receiving page, you compare the Auth querystring param with the
session var, and if they're different, you boot the user to an error page.
You also boot them if the session var is null, or the Auth querystring is
null/blank.

The test can be implemented as a separate static method that takes the
HttpContext; from there you can get to the session vars and the Request
querystring components, which makes the test simple.

This is nice because it lets you keep normal Urls, etc, avoid frames, etc,
but also guarantees that the user can't view a page unless they were
intentionally directed there from another page in the same app.

/// M

"Mark Rae" <ma**@mark-N-O-S-P-A-M-rae.co.uk> wrote in message
news:O$**************@tk2msftngp13.phx.gbl...
"MWells" <outbound__at_sygnal.com> wrote in message
news:ua*************@TK2MSFTNGP12.phx.gbl...
If you goals are simply;

+ To support Url-based state (i.e. no session state dependencies), but
+ To prevent normal users from jumping straight to a page


That's precisely it.
but I'm just throwing ideas at the
markerboard to see what sticks for you.


Some interesting suggestions - thanks very much.

Nov 19 '05 #6

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

Similar topics

1
by: phpkid | last post by:
Howdy I've been given conflicting answers about search engines picking up urls like: http://mysite.com/index.php?var1=1&var2=2&var3=3 Do search engines pick up these urls? I've been considering...
26
by: Howard Brazee | last post by:
I would like to click on a URL of a html document that will open several URLs at once for me. Does someone have an example of a html document that will do this?
1
by: DM | last post by:
I'm working on a site with more than 1700 HTML files. We'll be moving files around on this site a lot because we're reorganizing it. I'm thinking of writing a script that will convert all URLs in...
7
by: AES | last post by:
Encountered a URL containing a comma the other day -- the first time I've ever noticed that, so far as I can recall. It worked fine, however, and I gather commas are legal in URLs. Out of...
10
by: david | last post by:
Hi, all: I need a help from you about DataGrid control. I created a DataGrid, dg, in design view of .NET visual Stadio and use the builder to add a Hyperlink column to dg. I want to try to assign...
10
by: jflash | last post by:
Hello all, I feel dumb having to ask this question in the first place, but I just can not figure it out. I am wanting to set my site up using dynamic urls (I'm assuming that's what they're...
9
by: Salve =?iso-8859-1?Q?H=E5kedal?= | last post by:
What is the best regular expression for finding urls in plain text files? (By urls I mean http://www.something.com, but also www.something.com, or salve@somewhere.com) Salve
2
by: Simon Wigzell | last post by:
I have inherited a database driven website that comes with a table of image links. The images are scattered all of the internet and there are thousands of them. I would like to write an asp script...
3
by: WebCM | last post by:
How to apply nice URL-s into CMS? 1. Should we use nice urls for every page? 2. Do we need to put a FULL path into <a href="">? 3. What is faster and better? a) 10 rules in .htaccess...
4
by: Guy Macon | last post by:
As a personal learning experience with limited practical use, I have been doing some experiments with using .htaccess to redirect mis-typed URLs to a preferred canonical form. I have set up a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.