ASP question

Status
Not open for further replies.

Mark

Ars Scholae Palatinae
903
thanks for the quick reply, but Im an actually allowing anonymous login, so that doesnt work in this case like you said...and I might be wrong on this or unclear in my origional question, but what I need is the user id that the user signed on to there pc with , so that has to be a windows var. and I dont think Request.ServerVariables("LOGON_USER") will pick that up.
 

Telematx

Ars Tribunus Militum
2,841
code:<HR>
Code:
thisDomain = "aa\"    'change to your domain
LoginName	  = Replace(LCase(Request.ServerVariables("LOGON_USER")), thisDomain, "")<P>if Len(LoginName) = 0 Then
	' Anonymous access - we need to tell the browser that we need
	' authentication details. By denying access, we start
	' the challenge/response process, and the browser will request the
	' page again, this time with authentication details.
	' NB: Challenge/Response only works under IE
	Response.Clear
	Response.Status = "401 Access Denied"
	Response.End
end if


I might be wrong on this or unclear in my origional question, but what I need is the user id that the user signed on to there pc with , so that has to be a windows var. and I dont think Request.ServerVariables("LOGON_USER") will pick that up.

Assuming your users log into a network domain when they log into their computer, and assuming they use IE, then [FONT=courier new, courier]Request.ServerVariables("LOGON_USER")[/FONT] will work.
 

Mark

Ars Scholae Palatinae
903
ok, thanks again to everyone that has helped so far...so in looking at this again it seems like the fact that I allow for anonymous connections is the problem, so if I can change that, what do I change it to, from what I understand basic authentication sends passwords as plain text so thats not going to fly, anyone have any suggestions... oh by the way the webserver is IIS 5
 

kleel

Ars Scholae Palatinae
1,022
it depends ... if your IIS webserver is on a LAN and the users are already authenticated OR all your users are going to use IE then tick "integrated windows authentication"
I'm not sure if LOGON_USER works with basic authentication.

note that if the users are not logged on the domain already then they will be prompted with a NT style logon box which isnt what you are trying to achive... (if I'm not mistaken)

you could grab their IP addresses in asp and only let predefined ones in. though that will not work with anyone with dynamic IPs & may get confused if they are behind a NAT box.

you could also write a cookie on a particular page ... direct all the intended users to that page so that they all get the cookie ... then look for it on your main page/site.

just some ideas ... HTH
 
Status
Not open for further replies.