Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / November 2004

Tip: Looking for answers? Try searching our database.

Identifying the user

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bwmbagus - 06 Nov 2004 02:36 GMT
I am getting a strange result from some standard code.
Anyone got any ideas??

The puzzle
I have a web service calling System.Environment.UserName etc to return the
user name from the server. However, I get back NETWORK SERVICE or a null
string, rather then the user logged on to the client machine.
I have seperate server and client PC's, running XP
SP2 and Server 2003.
I have tried various server configs, - anonymous and not, with clear text,
with digest etc, and various clients. Always get the same result.
Martin Kulov - 06 Nov 2004 10:02 GMT
Hi,

Your web service runs under special account on the server depending on the IIS version that you use. In Win2003 this is NETWORK SERVICE, and in WinXP it is SYSTEM.

What are you trying to achieve? Have in mind that there may be more than one user currently logged on the machine.

Regards,
Martin Kulov
www.codeattest.com
bwmbagus - 07 Nov 2004 17:17 GMT
Thanx for trying.
In fact the problem was just about unsetting anonymous and setting Windows
Authentication for the intranet andf forms authentication for the external
internet access.
I needed a reboot to complete an install forgot about too.
In Wn2003 the App pool thread runs on NT AUTHORITY\NETWORK SEVICE which is
what you get back if you query System.Environment..Username or DomainName. I
had tried some whoami code using this means to access the current user
details copied from some proggy site I found. Need to use Context.User in a
web service.
By the way, there will be many users on the domain, but only one on a
physical client PC.

> Hi,
>
[quoted text clipped - 5 lines]
> Martin Kulov
> www.codeattest.com
Jeff Dillon - 06 Nov 2004 20:11 GMT
Without some authentication mechanism, you can't capture the username. Basic
Authentication works over the Internet, or Windows Auth on an intranet.

Jeff

> I am getting a strange result from some standard code.
> Anyone got any ideas??
[quoted text clipped - 7 lines]
> I have tried various server configs, - anonymous and not, with clear text,
> with digest etc, and various clients. Always get the same result.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.