|
 |
asp_web_howto thread: Logon username
Message #1 by "Lie Kai-Inge" <kai.lie@v...> on Mon, 16 Sep 2002 09:47:09 +0200
|
|
In what way can I read/retrieve the network logon username of the current
user in the Visual basic script code on an asp-page. It is an asp-page on
our intranet.
Is there a property of the session object that contains this info?
or, could I use a function that makes api-call to the server?
Thanks
Kai
---------------------------------------------------------------------------------------------------------------
This message has been checked for the presence of computer viruses.
---------------------------------------------------------------------------------------------------------------
Message #2 by "phil griffiths" <pgtips@m...> on Mon, 16 Sep 2002 10:33:54
|
|
Its Request.ServerVariables("LOGON_USER"). But it will be empty if you
allow anonymous browsing. Either:
1. change your site configuration to only allow NT Integrated (Challenge-
Response) access
2.put some code like this at the *top* of each page that requires the user
details:
If Len(Trim(Request.ServerVariables ("LOGON_USER"))) = 0 Then
Response.Status = "401 Unauthorized"
Response.AddHeader "WWW-Authenticate", "NTLM"
Response.End
End If
hth
Phil
>-------------------------------------------
> In what way can I read/retrieve the network logon username of the current
user in the Visual basic script code on an asp-page. It is an asp-page on
our intranet.
Is there a property of the session object that contains this info?
or, could I use a function that makes api-call to the server?
Thanks
Kai
|
|
 |