473,378 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Get UserPassword in ActiveDirectory

Hi,

I have a Login Page that have Active Directory permissions. I can get the
domain and the user that are trying to access application, but I need to
"know" the password that user insert, because I have to compare with another
password that I have in a Database. Only if their are equal, user can access
web application.

How can I know the password entered by user. I use this code to know user:

----------------------------------------------------------------------------
-------
Dim wi As System.Security.Principal.WindowsIdentity
wi = System.Security.Principal.WindowsIdentity.GetCurre nt()
Dim Domain_Slash_User As String = wi.Name()

Dim del As String = "\"
Dim user As String = Domain_Slash_User.Split(del.ToCharArray())(1)
Dim domain As String = Domain_Slash_User.Split(del.ToCharArray())(0)
----------------------------------------------------------------------------
-------
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca
Nov 18 '05 #1
4 1440
Hi ruca:

There is no way to pull a password out of active directory, or ask the
browser what password a user typed into the authentication dialog.
It's basically good security to keep these things hidden.

The only way to get a password is to prompt the user with your
controls and process the login with your code. One way to do this in
an active directory environment is to use Forms authentication but
authenticate against AD.

See "How To: Use Forms Authentication with Active Directory":
http://msdn.microsoft.com/library/de...SecNetHT02.asp
HTH,

--
Scott
http://www.OdeToCode.com

On Tue, 13 Jul 2004 14:04:55 +0100, "ruca" <ru***@iol.pt> wrote:
Hi,

I have a Login Page that have Active Directory permissions. I can get the
domain and the user that are trying to access application, but I need to
"know" the password that user insert, because I have to compare with another
password that I have in a Database. Only if their are equal, user can access
web application.

How can I know the password entered by user. I use this code to know user:

----------------------------------------------------------------------------
-------
Dim wi As System.Security.Principal.WindowsIdentity
wi = System.Security.Principal.WindowsIdentity.GetCurre nt()
Dim Domain_Slash_User As String = wi.Name()

Dim del As String = "\"
Dim user As String = Domain_Slash_User.Split(del.ToCharArray())(1)
Dim domain As String = Domain_Slash_User.Split(del.ToCharArray())(0)
----------------------------------------------------------------------------
-------


Nov 18 '05 #2

"ruca" <ru***@iol.pt> wrote in message
news:el**************@TK2MSFTNGP11.phx.gbl...
I have a Login Page that have Active Directory permissions. I can get the
domain and the user that are trying to access application, but I need to
"know" the password that user insert, because I have to compare with another password that I have in a Database. Only if their are equal, user can access web application.

How can I know the password entered by user. I use this code to know user:


You CANNOT look up a password in Active Directory. Ever. If you must compare
passwords because you have them stored in your own database somewhere then
you'll have to prompt the user for it.
Nov 18 '05 #3
For the record,
I've already have a solution for this case.
What I've done is using the LogonUser API, where I pass the user, the
domain, and then I pass the password that I have stored in my DB.
Now, what happens?

Very simple answer:
This LogonUser returns true or false. Like is easy to see if return true
means that the password stored in DB is equal of the ActiveDirectory, then
if false the user don't have permissions to see the page.
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca
"ruca" <ru***@iol.pt> escreveu na mensagem
news:el**************@TK2MSFTNGP11.phx.gbl...
Hi,

I have a Login Page that have Active Directory permissions. I can get the
domain and the user that are trying to access application, but I need to
"know" the password that user insert, because I have to compare with another password that I have in a Database. Only if their are equal, user can access web application.

How can I know the password entered by user. I use this code to know user:

-------------------------------------------------------------------------- -- -------
Dim wi As System.Security.Principal.WindowsIdentity
wi = System.Security.Principal.WindowsIdentity.GetCurre nt()
Dim Domain_Slash_User As String = wi.Name()

Dim del As String = "\"
Dim user As String = Domain_Slash_User.Split(del.ToCharArray())(1)
Dim domain As String = Domain_Slash_User.Split(del.ToCharArray())(0) -------------------------------------------------------------------------- -- -------
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

Nov 18 '05 #4

"ruca" <ru***@iol.pt> wrote in message
news:OK*************@TK2MSFTNGP11.phx.gbl...
For the record,
I've already have a solution for this case.
What I've done is using the LogonUser API, where I pass the user, the
domain, and then I pass the password that I have stored in my DB.
Now, what happens?

Very simple answer:
This LogonUser returns true or false. Like is easy to see if return true
means that the password stored in DB is equal of the ActiveDirectory, then
if false the user don't have permissions to see the page.


For reference, TESTING a password and GETTING a password are two different
things.
Nov 18 '05 #5

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

Similar topics

0
by: stegger | last post by:
I am trying to update a users password on OpenLDAP: $new = '{md5}' . base64_encode(pack('H*', md5($newpass_in_plaintext))); $this->result = ldap_modify($connection,...
2
by: bob | last post by:
Hi, Is this the right place to dicuss Visual Studio 2005 and .Net 2? I am try to implement a class (already using Windows Authentication) where I am given a user name and I return a list of...
2
by: Petra | last post by:
Hi I have problem reading the userPassword - Property from an Entry with the person-Schema using Microsoft Dotnet. I use DirectoryServices library and LDAP in my class. The code I used is as...
4
by: Sargas Atum | last post by:
Hi all, I am trying to get the field "lastLogon" out of ActiveDirectory. It should be trivial I thought, but it is not, as I have experienced. private DataRow FillDataRow( DataRow dataRow, ...
0
by: dhnriverside | last post by:
Hi guys I want to find out which of my ActiveDirectory users is logged on to a particular ActiveDirectory Computer. I can get what Computer a user is logged on to with ...
3
by: ruca | last post by:
Hi, I have a Login Page that have Active Directory permissions. I can get the domain and the user that are trying to access application, but I need to "know" the password that user insert,...
0
by: Ed Morrison | last post by:
I am trying to change the userPassword property of an Active Directory user account, but it does not work. I do not receive an error. The new password is not valid, but the old password still...
0
by: richardaz | last post by:
I have been working on a project to search for 250,000 different records in ActiveDirectory. The process takes a long time and I have tried everything to make it faster. Currently using...
0
by: myth0s | last post by:
Hi, The question: Is it possible to have two differents ActiveDirectory Membership Provider in web.config and change at run-time from the default provider to the second provider if the first one...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.