Solved

Safe redirection

Posted on 2002-06-13
8
282 Views
Last Modified: 2013-12-25
I have a problem that sounds very common in a web development nowadays, and suppose there is a common solution...
There are two WEB sites: A and B.
The user will log in on the site A. After this, the site A should somehow redirect the user's browser to site B letting him navigate this second site. The redirecting link should contain some parameters (like user ID). The user shouldn't ever be able to enter the site B directly, since the autentification information resides on the site A.

A solution which crossed my mind was to use https both to return redirection info (with user ID parameter) from the site A to the user, and later from browser to connect to site B.

Is there any "common solution" to this problem?
Thank you.
0
Comment
Question by:ekc
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 3

Expert Comment

by:davlun20080
ID: 7076793
A common practice would be to redirect, passing foward the user name and password if needed, or perhaps a variable like 'logged=true' in the querystring.

The page you redirect to on site B would read in the value of 'logged' and if true set session variable by same name to true.  Then add a little snippet on the top of each page that checks to see if the session variable 'logged' is true, else redirect back to site A.

Is this what you want (how people handle), or are you looking for code?

davlun
0
 
LVL 2

Accepted Solution

by:
englishman earned 100 total points
ID: 7077960
Yes, stick something in the querystring - but I would do something like encrypt the date and stick that in - this way noone would be able to simple write a value in the url string and get in without picking up the value from site A.
0
 
LVL 6

Expert Comment

by:Nitin Sontakke
ID: 7078439
The page to which you are redirecting on Site B can also have a following check...


If Request.ServerVariables("HTTP_REFERER") <> "PageFromSiteA.asp" Then

    'invalid login...
    'Redirect back to site a...
End If

'Usual site b code...

http_referer will give name of the previous page, that should match with the name of page you redirecting from.
0
 
LVL 3

Expert Comment

by:davlun20080
ID: 7078537
As for encryption, that is good.  you can also get it out of the querystring by adding headers to the file in asp and transferring the user in secure mode.

davlun
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 5

Author Comment

by:ekc
ID: 7079181
Thank you all.

And what about https?

Is it possible do it using https and without encrypting?
Or to combine those two?
Timesptamp is not very reliable, since there are two servers in the game and you never know...
0
 
LVL 3

Expert Comment

by:davlun20080
ID: 7080144
Yes, you can send the info to the other server in a form or in the query string, in secure mode.  Or you can add headers with the values needed and transfer that way in secure mode as well (I have never done it this way personally, but do believe it is done on many sites).

0
 
LVL 2

Expert Comment

by:englishman
ID: 7080807
https?
The answer is surely no - if the key is in the querystring from the first site to the second, encryption is the only way to go.
0
 
LVL 5

Author Comment

by:ekc
ID: 7083746
Ok. Thank you once more.
This time, englishman gets the points, I'll try this his way.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Accessibility and Usability are two concepts that seem to be closely related.  But, too many people seem to have a distorted perception of them. During last five years, those two words have come to the day-to-day work of almost every web develope…
Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now