|
 |
asp_web_howto thread: How to get the login in NT from the ASP
Message #1 by "Paula Durán" <pduran@s...> on Thu, 22 Feb 2001 16:01:11
|
|
I need to get the login in Windows NT in the ASP and display it, any idea??
(Transferred from another list - moderator)
Message #2 by SamS@e... on Thu, 22 Feb 2001 08:11:00 -0800
|
|
dim LogonUser
LogonUser =3D request.servervariables("LogonUser")
LogonUser =3D
mid(LogonUser,instr(LogonUser,"\")+1,(len(LogonUser)-instr(LogonUser,"\"
)))
-----Original Message-----
From: Paula Dur=E1n [mailto:pduran@s...]
Sent: Thursday, February 22, 2001 4:22 PM
To: ASP Web HowTo
Subject: [asp_web_howto] How to get the login in NT from the ASP
I need to get the login in Windows NT in the ASP and display it, any
idea??
Message #3 by "Eric Van Camp" <eric@a...> on Thu, 22 Feb 2001 17:19:09 -0000
|
|
you have to activate nt authentication for your website, i sppse you already
did... if so the login is part of your http header...
response.write (request.serverVariables("logon_user) )
should do it..
by the way th request.servervariables("auth_type") should be ntLM if you set
nt authentication!
eric
-----Original Message-----
From: Paula Durán [mailto:pduran@s...]
Sent: Friday, February 23, 2001 12:22 AM
To: ASP Web HowTo
Subject: [asp_web_howto] How to get the login in NT from the ASP
I need to get the login in Windows NT in the ASP and display it, any idea??
Message #4 by "Wanschek, John J" <jjwansch@i...> on Thu, 22 Feb 2001 10:33:56 -0600
|
|
Note: You first need to make changes to IIS Authentication. Unselect the
Allow Anonymous Access. Make sure that Windows NT Challenge/Response is
selected. This will force the server into checking that the user is on the
Domain. If he or she is not logged in on the Domain they will not be granted
access.
The Down fall to this is it restricts your users to using Internet Explorer.
Netscape does not know anything about NT Authentication.
This code will then display your user.
LoggedOnUser = Request.ServerVariables("AUTH_USER")
intLength = Len (LoggedOnUser)
For i = 1 to intLength
strChar = mid(LoggedOnUser,i,1)
if strChar = "\" then
LoggedOnDomain = left(LoggedOnUser,(i-1))
LoggedOnUser = right(LoggedOnUser,(intLength - i))
end if
next
Response.Write "<P>Logged on as: " & LoggedOnUser & "<P>"
Response.Write "Logged on Domain is: " & LoggedOnDomain & "<P>"
JJW
-----Original Message-----
From: Paula Durn [mailto:pduran@s...]
Sent: Thursday, February 22, 2001 6:22 PM
To: ASP Web HowTo
Subject: [asp_web_howto] How to get the login in NT from the ASP
I need to get the login in Windows NT in the ASP and display it, any idea??
Message #5 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Thu, 22 Feb 2001 17:04:05 -0000
|
|
request.servervariables("LOGON_USER")
or
request.servervariables("AUTH_USER")
this value will be empty if anonumous access is allowed. You need to
remove
Anonymous Access and ensure that "Challenge/response" is on. Basic
Authentication should be off as well, so that the users don't have to
type
their username/pwd in again.
-----Original Message-----
From: Paula Dur=E1n [mailto:pduran@s...]
Sent: Friday, February 23, 2001 12:22 AM
To: ASP Web HowTo
Subject: [asp_web_howto] How to get the login in NT from the ASP
I need to get the login in Windows NT in the ASP and display it, any
idea??
_______________________________________________________________________
Scottish Enterprise Network
http://www.scottish-enterprise.com
Message #6 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Thu, 22 Feb 2001 17:07:24 -0000
|
|
I forgot that challenge/response is not supported by netscape... thanks!
-----Original Message-----
From: Wanschek, John J [mailto:jjwansch@i...]
Sent: Thursday, February 22, 2001 4:34 PM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: How to get the login in NT from the ASP
Note: You first need to make changes to IIS Authentication. Unselect the
Allow Anonymous Access. Make sure that Windows NT Challenge/Response is
selected. This will force the server into checking that the user is on the
Domain. If he or she is not logged in on the Domain they will not be granted
access.
The Down fall to this is it restricts your users to using Internet Explorer.
Netscape does not know anything about NT Authentication.
This code will then display your user.
LoggedOnUser = Request.ServerVariables("AUTH_USER")
intLength = Len (LoggedOnUser)
For i = 1 to intLength
strChar = mid(LoggedOnUser,i,1)
if strChar = "\" then
LoggedOnDomain = left(LoggedOnUser,(i-1))
LoggedOnUser = right(LoggedOnUser,(intLength - i))
end if
next
Response.Write "<P>Logged on as: " & LoggedOnUser & "<P>"
Response.Write "Logged on Domain is: " & LoggedOnDomain & "<P>"
JJW
-----Original Message-----
From: Paula Durn [mailto:pduran@s...]
Sent: Thursday, February 22, 2001 6:22 PM
To: ASP Web HowTo
Subject: [asp_web_howto] How to get the login in NT from the ASP
I need to get the login in Windows NT in the ASP and display it, any idea??
________________________________________________________________________
Scottish Enterprise Network
http://www.scottish-enterprise.com
Message #7 by "Sertial, Sam" <2495XX2@a...> on Thu, 22 Feb 2001 15:46:33 -0500
|
|
dim strUserName
'strusername =3D Request.ServerVariables("LOGIN_USER")
strUserName =3D mid(Request.ServerVariables("logon_user"),6)
|
|
 |