Solved

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

Posted on 2008-10-15
9
765 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
  • 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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
401 - Error 6 25
Azure Web App - See files 3 21
crm development 2 37
Calling stored proc in EDMX 11 19
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
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.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

760 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

21 Experts available now in Live!

Get 1:1 Help Now