all groups > inetserver asp general > november 2005 >
You're in the

inetserver asp general

group:

use windows username and password on asp


use windows username and password on asp nikou_70 NO[at]SPAM yahoo.com
11/30/2005 4:42:59 PM
inetserver asp general:
I have a problem with ("auth_user") in asp,I try to use windows
username and password in asp page for limitation user access to pages,
but this server variable returns empty string, can you help me ,I
appreciate it.
Re: use windows username and password on asp Bob Barrows [MVP]
12/1/2005 7:17:43 AM
[quoted text, click to view]

No, he wants to use "windows usename" Why would you advise him to deactivate
the windows logon checkbox??

He has to turn off Anonymous Access in order to see anything in "auth_user"
or "logon_user", which is the one I use.

[quoted text, click to view]

That's not true.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: use windows username and password on asp Bob Barrows [MVP]
12/1/2005 7:27:19 AM
[quoted text, click to view]

You forgot to diable "Anonymous" access in IIS Manager.
I prefer to use "logon_user", but "auth_user" should work as well.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: use windows username and password on asp Bob Barrows [MVP]
12/1/2005 8:41:24 AM
[quoted text, click to view]

Ahh, that explains it...

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Re: use windows username and password on asp Gottfried Mayer
12/1/2005 11:21:34 AM
[quoted text, click to view]

Hi nikou_70,

You have to either deactivate the "windows logon" checkbox in the IIS
Server configuration (under Security) so that only "anonymous" and
"basic authentication" is active

or if you are using a Active Directory Domain, you can get the user
information with the ADSystemInfo Object:

Example Code:

<%
Dim oAD,oUser,strUserDN,strUserName,strFullName

Set oAD = Server.CreateObject("ADSystemInfo")
On Error Resume Next 'disable Error Checking
strUserDN = oAD.UserName
Set oAD = Nothing

If Err = 0 Then 'no error occured
On Error Goto 0 'enable Error Checking
Set oUser = GetObject("LDAP://" & strUserDN)
strUserName = oUser.SamAccountName
strFullName = oUser.FullName
Set oUser = Nothing
Response.Write "You are User [" & strFullName & _
"] with Username [" & strUserName & "]."
Else
On Error Goto 0 'enable Error Checking
Response.Write "ERROR: You are no Active Directory User!"
End If
%>


HTH
Re: use windows username and password on asp Gottfried Mayer
12/1/2005 2:30:34 PM
[quoted text, click to view]

Hi Bob,

You're right, of course...

If you only want authenticated users to access your page (anonymous
users from outside your company will have to log on before they see
anything), you just have to deactivate the "anonymous access" in IIS

I'm currently working on a project that uses mixed
anonymous/authenticated Access to display different (public and
internal) data, there I had to configure IIS like I stated in my last
post, and I used the ADSystemInformation to get the current user (with
Group membership and the whole show...)

Maybe I am a bit confused right now.

AddThis Social Bookmark Button