PDA

View Full Version : Pulling logon info from windows


classicwingcook
09-09-2002, 11:22 AM
Here's a good one. I'm setting up an intranet page and need to show some specialized items when the boss logs on, but not everyone else. The problem is that I'm having trouble pulling the windows login info from the computer through ASP. I'm going to try ASP.NET, but I would like to stay with classic ASP if at all possible. REMOTE_USER and the other server-side variables are not working at all.

Any ideas?


Thanks

EnwTheGood
09-09-2002, 07:55 PM
I've seen something about REMOTE_USER and LOGIN_USER returning null values before, but the only thing I could find was http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_11873199.html

Perhaps the 18th comment will help.

If this doesn't help at all, then just ignore my bandwidth-hogging rants.

Josh
09-10-2002, 03:19 AM
you can use cookie session
here is an example code

<html>
<body>
<%
login=request("login")
pass=request("pass")
if login = "abc" and pass = "1234567890" then
session("login") = login
response.write "correct<br>"
else
if login <> "" then response.write "incorrect<br>"
end if

if session("login") = "" and login = "" then
response.write "<form method=post action=""singlepassword.asp"">"
response.write "Login:<input type=text name=login><br>"
response.write "password:<input type=text name=pass><br>"
response.write "<input type=submit value=""Login"">"
response.write "</form>"
end if
%>
</body>
</html>

HTH:)

EnwTheGood
09-10-2002, 04:24 AM
But that's a login box; it doesn't take info from the Windows logon, which is definately possible using ASP.

Dynasty
09-10-2002, 04:41 AM
LOGON_USER is apparantly only avaliable if you don't allow anon access to the folder, so it pops up a login box when the page is accessed.

Josh
09-10-2002, 04:58 AM
oops,sorry i didn't get the point:(

classicwingcook
09-10-2002, 06:36 AM
Thanlks for the help.

Enw: The link showed me a couple of things that I was missing, but still not exactly what I'm looking for.

I'm tring to get it so that there is no extra logging in. Once the person goes to the web site, it's automatically pulled from the windows logon. That way, no matter where he logs in from(we don't have roaming profiles) he can access the info.

Hope I explained correctly.

kevotheclone
09-10-2002, 03:36 PM
You can do exactly what you want with classic ASP.

Using IIS' administration dialog boxes you disable "Anonymous access" and enable "Integrated Windows authentication". These are found in the "Directory Security" tab. Once you set IIS up correctly the Server variables you mentioned will be populated with "DomainName\UserID".