By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,234 Members | 1,869 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,234 IT Pros & Developers. It's quick & easy.

Get UserPassword in ActiveDirectory

P: n/a
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 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

"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 20 '05 #2

P: n/a
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 20 '05 #3

P: n/a

"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 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.