Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
We have a huge asp web station project using windows authentication to login and manage the
operation authority .As we all known ,IIS and web.config were setted using windows
authentication ,and when logged into the web page ,default windows login dialog box will
popped up. But our customer hate default windows login dialog box and want me to write a
portal webpage using windows account to log in that asp web station . I cannot write asp
programs ,and only can write asp.net and C# programs,and how can I do it?
Posted

1 solution

The below code will work only in case proper username & password is passed else error will be returned
<%
Set adObject = GetObject("WinNT:")
Set userObject = adObject.OpenDSObject("WinNT://" & domainName, userName, password, ADS_SECURE_AUTHENTICATION)
%>
 
Share this answer
 
v2
Comments
feng4887 24-Sep-13 22:10pm    
Can u give full demo codes??? Thanks!
Madhu Nair 25-Sep-13 1:03am    
On click on Login button you have to call the code i posted. It will give error if invalid username or password is passed.

Assign your actual domain name, user name & password entered by the user to the variables domainName, userName & password variables in the code i posted.


You will also will have to handle error in case of invalid credentials
feng4887 29-Sep-13 21:51pm    
all those writen in java script?
feng4887 29-Sep-13 21:53pm    
all those program written in java script? thanks
Madhu Nair 30-Sep-13 5:36am    
No... the code I pasted is ASP

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900