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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Capture NT logon information using ASP

Status
Not open for further replies.

anilsantoshs

Programmer
Sep 16, 2003
18
FR
Hi,

I would like to use the NT logon information to authenticate in my website.

I use ASP and Oracle in my web site. I would like to know how i can use the NT logon information so that the same information can be used in my website for authentication.

Thanks,

Anil
 
You could just turn off anon access and then set the permissions on the files and folders on your web site.

If maintaing these permissions is too much of a hassle then you can use the Request.ServerVariables to check the value of LOGON_USER. If it is empty then send a 403 to the browser. The browser will resubmit the request with this header. Once you have the value you can look it up in a database table of authenticated users. Even though there is a header for password, you won't get it using this technique, only the username.

 
Thanks a lot Sheco.

I would also appriciate if i could an example of code on retreiving this information,.

THanks

Anil
 
Here is a little VBScript ASP I use to view the server variables.

Code:
<%@ Language=VBScript %>
<html>
	<head>
		<title>What's in the Request.ServerVariables collection?</title>
	</head>
	<body>
		<table border="1">
			<tr>
				<th>Item</th>
				<th>Value</th>
			</tr>
<%
Dim oItem
For Each oItem in Request.ServerVariables 
%>
			<tr>
				<td valign="top"><%= oItem %> &nbsp;</td>
				<td valign="top"><%= Request.ServerVariables(oItem) %> &nbsp;</td>
			</tr>
<%		
Next
%>
		</table>
	</body>
</html>
 
Also, if "403 Forbidden" doesn't work then you might try setting Response.Status to "401 Unauthorized" instead.
 
Thanks a lot Sheco.

That worked and now i can design my website.

Anil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top