Getting WIndows Login Name From ASP.NET

  • Thread starter Thread starter Ben
  • Start date Start date
B

Ben

Hi All,
I would like to get the windows logon name for a .net intranet app.
I have tried
Page.User.Identity.Name(),
Request.ServerVariables["LOGON_USER"].ToString(),
Request.ServerVariables["REMOTE_USER"].ToString();
They have all returned null so far.

I have windows authentication enabled in web.config.(Code is running on
a Dev box & not on the local machine)

Please Help !

Thanks in advance,
Ben
 
Uncheck "Anonymous Access" and ensure that "Integrated" is checked in the
Directory Security tab in IIS Manager for the site.
Peter
 
Thanks Peter ! That worked like magic. One more question - if this .net
app were to be used from intranet & internet, would disabling anonymous
access be a problem?Any other points to keep in my mind shud this
situation arise?

Thanks !
 
If your app is going to be visited from the internet, the visitors would not
be transmitting their windows login credentials that they get when they login
to their machine in the morning from your local internal network, so yes, it
would be a problem. You might have to offer some sort of mixed mode
authentication. Experiment and find out.
Peter
 
The internet site that redirects has a login so I am using those
credentials instead for user validation which seems to workfine for
now.

Is there a way to get the name of the person logged in & not just the
logon name
(Ben Arthur - Full Name Vs arthurb - Logon name)

Any help is greatly appreciated.
Thanks,

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top