Solved

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

Posted on 2008-10-15
9
770 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
Independent Software Vendors: 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

738 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