Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Authenticate using a web form?

Status
Not open for further replies.

Ayac

Programmer
Nov 10, 2000
141
HU
Hi all!

I had this question before but I did not really find a good answer. We have windows password protected area on our server (Win2003) and we would like to have a nice web form up on our site that can authenticate users (let them get to the protected area) without having that ugly popup window that needs all kinds of things to type in to get in.

Anyone knows how to do it, where I should start looking?
 
well hate to resort to third party here, but authentix makes an extremely robust authentication module, that you can use via web form, via nt auth, stored members table in DB or many other options.

you can use it to convert ugly grey window requests into pretty web forms, and then pass the values to authentix to preauth into secure areas.

about all i know of that has that kind of flexibility and gets rid of the ugly grey boxes that uses NT auth
 
Thanks for the tip, altough I am looking for some custom solution that we could make up from scratch without spending any money if possible... there is gotta be a way, or not?...
 
It's not hard to write your own, you just need to have a database of valid usernames and passwords and then write some pages with forms to log in. I wrote something like this to have a password protected section on my website. I use session variables to store the users logged in status.
 
I know and I do that too, but this time I want to have Windows security involved. I do not want to maintain two databases. Where does Windows store usernames and passwords? There has to be a db somewhere... Or is there a way to sync a SQL database with Microsoft's Active Directory?
 
user/pass in windows is stored .. cant remember in the registry or the user.da0 file, which would be useless to you at this point because windows uses hash encryption of the info.

you would need to research how to call the windows authentication API and write your own component, which wont be easy

 
You'll need to use LDAP calls to authenticate. Here are some sniplets to get you started.

Public Function Authenticate() As Boolean
If strLogin = "" Or strPassword = "" Then Return False
Try
Dim con As Object = GetObject("LDAP:")
Dim qryStr As String = "uid=" & strLogin & "," & strOrgUnit
Dim ldConn As Object = con.openDSObject("LDAP://" & strLDAPServer & ":" & m_ldapPort, qryStr, strPassword, 0)
Return True
Catch ex As Exception
Return False
End Try
End Function

Here's another post that might provide some good info.

One thing you might run into is if you don't know the OU the user is in (assuming you are running AD), you'll have to search the whole AD. I couldn't find my code that did that, but if you still have problems, I could possibly find it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top