473,778 Members | 7,750 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Storing Variable for use in different page

I have a website that uses forms based authentication. In the logon.aspx
page a user enters a username and password. It is then authenticated
against Active Directory.

After that point on any page in the directory I can access the username
using HttpContext.Cur rent.User.Ident ity.Name, but I can't figure out how to
access the password in plain text. Back at the logon.aspx page if I could
store the password that is submitted the authentication subroutine so that
it could be accessed by other pages I would be in business.

--

Steve Evans
Email Services
SDSU Foundation
(619) 594-0708

Nov 18 '05 #1
5 1188
"- Steve -" <se****@foundat ion.sdsu.edu> wrote in message
news:e9******** ******@TK2MSFTN GP11.phx.gbl...
I have a website that uses forms based authentication. In the logon.aspx
page a user enters a username and password. It is then authenticated
against Active Directory.

After that point on any page in the directory I can access the username
using HttpContext.Cur rent.User.Ident ity.Name, but I can't figure out how to access the password in plain text. Back at the logon.aspx page if I could
store the password that is submitted the authentication subroutine so that
it could be accessed by other pages I would be in business.


It is generally considered bad practice to store cleartext passwords at all.
What do you need the password for? And why can't you just store it in
Session state.
--
John Saunders
johnwsaundersii i at hotmail
Nov 18 '05 #2
I need to run the page as a user with permission to create users in the
Active Directory. So to impersonate the thread I've been told I need to use
the "Impersonat e a Specific User in Code" from
http://support.microsoft.com/default...b;en-us;306158, which needs
the username and password of the user account you want to impersonate.

If there's a better way I'd love to hear it.

--

Steve Evans
Email Services
SDSU Foundation
(619) 594-0708
"John Saunders" <jo************ **@notcoldmail. com> wrote in message
news:u2******** ******@TK2MSFTN GP09.phx.gbl...
"- Steve -" <se****@foundat ion.sdsu.edu> wrote in message
news:e9******** ******@TK2MSFTN GP11.phx.gbl...
I have a website that uses forms based authentication. In the logon.aspx page a user enters a username and password. It is then authenticated
against Active Directory.

After that point on any page in the directory I can access the username
using HttpContext.Cur rent.User.Ident ity.Name, but I can't figure out how to
access the password in plain text. Back at the logon.aspx page if I could store the password that is submitted the authentication subroutine so that it could be accessed by other pages I would be in business.


It is generally considered bad practice to store cleartext passwords at

all. What do you need the password for? And why can't you just store it in
Session state.
--
John Saunders
johnwsaundersii i at hotmail

Nov 18 '05 #3
"- Steve -" <se****@foundat ion.sdsu.edu> wrote in message
news:ug******** ******@tk2msftn gp13.phx.gbl...
I need to run the page as a user with permission to create users in the
Active Directory. So to impersonate the thread I've been told I need to use the "Impersonat e a Specific User in Code" from
http://support.microsoft.com/default...b;en-us;306158, which needs the username and password of the user account you want to impersonate.

If there's a better way I'd love to hear it.


Unless you need audits of the creation of users to show up with the username
of the creating user, you could simply run the web site under a domain user
and not as ASPNET.

I presume there's a reason you're using Forms Authentication and not Windows
Authentication?
--
John Saunders
johnwsaundersii i at hotmail
Nov 18 '05 #4
Wouldn't running an IIS site as a domain user that can create users be more
dangerous than storing a password in memory for a few minutes?

I'm using forms authentication instead of IIS authentication because of
style and form. The pop-up logon box isn't very professional.

I could always just encrypt and decrypt the string as I go correct?

--

Steve Evans
Email Services
SDSU Foundation
(619) 594-0708
"John Saunders" <jo************ **@notcoldmail. com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
"- Steve -" <se****@foundat ion.sdsu.edu> wrote in message
news:ug******** ******@tk2msftn gp13.phx.gbl...
I need to run the page as a user with permission to create users in the
Active Directory. So to impersonate the thread I've been told I need to use
the "Impersonat e a Specific User in Code" from
http://support.microsoft.com/default...b;en-us;306158, which

needs
the username and password of the user account you want to impersonate.

If there's a better way I'd love to hear it.


Unless you need audits of the creation of users to show up with the

username of the creating user, you could simply run the web site under a domain user and not as ASPNET.

I presume there's a reason you're using Forms Authentication and not Windows Authentication?
--
John Saunders
johnwsaundersii i at hotmail

Nov 18 '05 #5
"- Steve -" <se****@foundat ion.sdsu.edu> wrote in message
news:Ov******** *****@tk2msftng p13.phx.gbl...
Wouldn't running an IIS site as a domain user that can create users be more dangerous than storing a password in memory for a few minutes?
I'm not certain that you'd have to run the entire site that way. It might be
possible to create a small sub-application with only the pages which require
domain user access and run that with a different account. I've never tried
this, so I don't know if it's possible. Maybe only in IIS 6.
I'm using forms authentication instead of IIS authentication because of
style and form. The pop-up logon box isn't very professional.
The pop-up logon box is how IE does it. It does that for every site which
uses browser-based authentication as opposed to forms authentication.
I could always just encrypt and decrypt the string as I go correct?


Yes. If I were you, I wouldn't store the password, only the encrypted
password. I'd also make sure my login page required SSL, so you're not
sending passwords in the clear.
--
John Saunders
johnwsaundersii i at hotmail
Nov 18 '05 #6

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

Similar topics

2
1772
by: Francisco | last post by:
I have this problem: I have a database with information about games, and users are able to vote for them. Everytime a user votes for a game I store the unique game name into a session variable (an array). So if they are in a page were they already voted, they won't have the option to do so. The idea is that the session cookie lasts "forever", I don't want them voting for the same game everytime they get to the site. This isn't soo strict,...
3
11763
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a table in MySQL with the path & filename to the image. I have successfully uploaded and performed an update query on the database, but the problem I have is I cannot retain the primary key field in a variable which is then used in a SQL update...
3
1786
by: Sean | last post by:
HI, I have a shopping cart in which I am trying to use breadcrumb style navgiation. I need to be able to display the categroy heading relating to the section of the site a visitor is using i.e If a user is in the "camera" section I need to display that heading as a link "camera", however in order to do this at the moment I am querying the database and storing the recordset in the application object (see below). I should imaging there is...
14
5849
by: Luiz Antonio Gomes Pican?o | last post by:
How i can store a variable length data in file ? I want to do it using pure C, without existing databases. I'm thinking to use pages to store data. Anyone has idea for the file format ? I want to store data like a database: ---------------------------------- Custumer:
0
1107
by: Sandra | last post by:
I am using a VB6 COM object with an asp.net project. I am storing the COM object in a session variable but am having a problem accessing the COM object from the session variable. I am getting the error: QueryInterface for interface object.class failed I am able to create new instances of the object with no problems but as soon as I cast the session variable to the object like so: CType(Session("object"),object.class)
2
1751
by: Al Wilkerson | last post by:
Hey guys, I'm having problems with creating/storing a value in a session variable for later retrieving on another page. Here is the aspx page where I create/store the value <%Session="programming";%> <asp:HyperLink id="hlnkProgramming"Target="main" NavigateUrl="CategoryResults.aspx">Programming</asp:Hyperlink>
2
1070
by: Angel | last post by:
I am storing a value into a javascript variable that was keyed into a text control. When the code performs a postback, the value that was stored into a clientside variable no longer exists. Is there anything I can do, to not lose that value in the clientside variable when a postback is performed?
2
1710
by: Curt tabor | last post by:
Hi, I have several pages in my app that all use the same oleDBConnection(s). When this connection gets created, I store it as a Session variable so that other pages can access it w/o having recreate new connections every time they load. I noticed during development that when ever the app first started, the connection would not be in Session when I navigvated to a page that used it. But with subsequent calls everything would be fine and...
3
2046
by: RSH | last post by:
Hi, I have a situation where I have created an object that contains fields,properties and functions. After creating the object I attempted to assign it to a session variable so i could retrieve the information it contained on another page. This was significant because I am initially loading the data from the database, then storing relevent information in the object, I am allowing users to change the data then preview the modifications...
0
9629
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9470
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10069
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9923
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7475
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5500
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4033
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3627
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2865
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.