473,322 Members | 1,690 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Getting WIndows Login Name From ASP.NET

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

*** Sent via Developersdex http://www.developersdex.com ***
Oct 10 '06 #1
5 2830
Uncheck "Anonymous Access" and ensure that "Integrated" is checked in the
Directory Security tab in IIS Manager for the site.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Ben" wrote:
>

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

*** Sent via Developersdex http://www.developersdex.com ***
Oct 10 '06 #2
Ben

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 !
*** Sent via Developersdex http://www.developersdex.com ***
Oct 11 '06 #3
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

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Ben" wrote:
>
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 !
*** Sent via Developersdex http://www.developersdex.com ***
Oct 11 '06 #4
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
Peter wrote:
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

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Ben" wrote:

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 !
*** Sent via Developersdex http://www.developersdex.com ***
Oct 19 '06 #5
Ben


Any suggestions ? Anyone ?

*** Sent via Developersdex http://www.developersdex.com ***
Oct 20 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Toralf Lund | last post by:
Is there any way at all I can get a user's login name from within JavaScript on Unix/Linux with Mozilla browser. If not, how about the home directory? I know there are *usually* variables...
2
by: John | last post by:
Hi How can I get the currently logged in username from windows 2000/xp? Thanks Regards
5
by: Mike Turco | last post by:
(This was also posted to comp.database.ms-access before I realized this was the hep group.) Lets say that my WinXP computer has two users: Michael and Kathryn. One or the other logs into the...
2
by: HK guy | last post by:
How to use C# to get the login name of the windows? Thank you.
4
by: Dave | last post by:
Greetings, I have a web application that will be hosted on our intranet. I would like to determine, via code the user's windows login name and domain in the following format: DOMAIN\loginname...
8
by: Mike P | last post by:
How do you get the Windows login and password of the person who is logged in? Is it possible? *** Sent via Developersdex http://www.developersdex.com ***
12
by: satas | last post by:
Hello. Is there any way to find out Windows Login Name in such browsers like Firefox? I know that code below allows to do this in IE : function show_win_login() { var usern var...
3
by: =?Utf-8?B?Sm9zZXBo?= | last post by:
In a Winform application using VB.Net is there a way to capture the user's Windows login name? Any help would be greatly appreciated, thanks.
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.