Solved

How to auto login to a website from within an asp.net page

Posted on 2008-10-15
9
771 Views
Last Modified: 2012-05-05
I have an application that looks up (in a database) a user's name and password. I want to create a link to a know URL (always the same URL) that passes the user's login information (username and password) to the site and the given URL and logs them in. Is there a way to do this in asp.net?
0
Comment
Question by:freedom22
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
9 Comments
 
LVL 6

Expert Comment

by:pwrBall
ID: 22724951
Is the site you are passing them to a site that you manage as well?
0
 

Author Comment

by:freedom22
ID: 22725036
Yes, it is a site that I manage.
Users go to the URL, enter a username and password and click Submit.

Thanks
mark
0
 
LVL 6

Expert Comment

by:pwrBall
ID: 22726024
If both sites are ASP .NET sites, it should be doable.

When the user logs into the first site, you could store their username and password in the Session object, thus dynamically creating the query string of the URL you are speaking of by reading the Session object and obtaining the username and password.  Then once they click the link, the site they go to would have code in the Page Load that would read the query string and log the user in.  

If I were to do something like that though, I would probably write some little encryption/decryption scheme, so that the users information is not exposed for all to see in the URL you are passing.  And once you reach the other site, the password would be decrypted.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:freedom22
ID: 22727161
Hi pwrBall,

Thanks for your comments. It might be a little simpler. The username and password that I want to send along with the URL to the new site are NOT the username and password used to login to the original site. They are harvested from a database that I am searching in the first site. So I have the username and password in the details view control. The question is how to use those fields (that i have in the Details View) to login to the next site.

Hopefully I don't have to use a querysting attached to the URL?

Mark
0
 
LVL 6

Expert Comment

by:pwrBall
ID: 22733503
I see.  Ok, well as long as you have access to get their username and password without them having to type it in, that should work.  Just the data from the details view.  Are you having issues on how to actually get the data from the details view and store it somewhere?

If you don't want to use the query string, you could use Cookies.  

Here's some info on them:
http://msdn.microsoft.com/en-us/library/ms178193.aspx


0
 

Author Comment

by:freedom22
ID: 22733671
Hi pwrBall,

Thanks for your message. Yes, I don't know how to get the username and password from the DetailsView page and then use it to login to the new URL.

Thanks
mark
0
 
LVL 6

Accepted Solution

by:
pwrBall earned 500 total points
ID: 22733855
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

724 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