How to get client user name?

Hi all,

 

I have a ASP.NET project deployed in company domain, I need to implement single-sign on in it, it means when client pc opens this web site, system will get client user name and sign in automatic, the users from client were authenticated in domain.

Currently, I use following three ways to get client user name:

HttpContext.Current.User.Identity.Name
Thread.CurrentPrincipal.Identity.Name
Request.ServerVariables["logon_user"]

In IIS, if checked 'Anonymous Access', it will ignore the user information from client, and the three methdos above returned blank.

If unchecked 'Anonmous Access',  whatever I did, i.e.: change authentication mode in web.config, add <allow users="*"/> section in it...system always prompted windows login form to sign in,  but user has already authenticated in client....I want to get client user name which logined in client pc, is this possible? Please advice, thanks.

Regards,

 

0
best
4/27/2009 3:40:51 AM
asp.net.security 27051 articles. 1 followers. Follow

4 Replies
607 Views

Similar Articles

[PageSpeed] 57

You should check authentication mode in web.config file,  it should be set to "Windows":

<authentication mode="Windows" />

0
kipo
4/27/2009 8:26:06 AM

I guess you are using 'Forms' authentication. 'Windows' mode will work for you. i am sorry to say that you have either choose one of them for your apps.

Instead of sorry, there is a good news if you are willing to do some tweaking using 'mixed mode' authentication:)

Here you go,

http://www.15seconds.com/Issue/050203.htm

gud luck.

 


gregale.NET, implico.de

0
Gregale
4/27/2009 8:39:49 AM

Resolved, I used pc name instead of IP in address bar, it works well now, thank you all of you.

0
best
4/28/2009 3:34:35 AM
what a wonderful idea u have done! i should apply this for any incoming internet apps too...:)

gregale.NET, implico.de

0
Gregale
4/28/2009 3:48:56 AM
Reply:

Similar Artilces:

Getting the computer name of the client user
Is it possible to get the client's computer name?ez Ez416:Is it possible to get the client's computer name? I dont think so.I do not think a post/get request will send such information. It can be done using an ActiveX object, but the client computer's setting has to be set to a ridiculously low level.When you ask a question, remember to click "mark as answered" when you get a reply which answers your question.My latest ASP.NET AJAX blog entries. Probably it is enough to use Request.UserHostName and Request.UserHostAddress (on server-side). no?[MCPD: WEB]...

How do I get the name of the user logged in on the client
I'm working on an intranet app. I need to get the username on the client in order to display personal stuff. How do I do this?? David LeggDave Legg NOTE: The Intranet app is hosted on the same computer as that is the only computer. David LeggDave Legg Check the server variables connected to the request object. One of them (I think USERNAME or something - look it up) has the name of the logged on user. WHEN the IIS is configured in such a way that it actually retrieves the user's name.Thomas TomiczekPowerNodes ApS(Microsoft MVP C#/.NET)---Building a Website? Try the PowerNodes CM...

Can not get user name from HttpContext.Current.User.Identity.Name
Hi All; I have tried to use HttpContext.Current.User.Identity.Name to get window user account. However, from debugger, for a long time ago I saw my window user name. But now, I did not see my window user name (from debugger) with the same code and same function call. Please help. Was I doing something wrong? Or any special settings on web.config/machine.config or project to make it work??? I'm stuck Thanks a lot well, you have to have windows integrated authentiction enabled in IIS, IIRC.RTFM - straight talk for web developers. Unmoderated, uncensored, occasionally unre...

How to get the user name of a process in vb.net?
Could anybody tell meHow to get the user/owner name of a process in vb.net?The reason I need it is because I developed an application,which I will put on the winnt enviroment, I want to allow multiple instance.but only allow one single instance per user.I am using Application.Run(MyMainForm) to start my applicationThanks,Joseph...

Problem in getting logged in user Name for ASPX page with (even with this.User.Identity.Name)
Hi  friends,  I am creating an application that takes current logged in user and displays on the page itself. for this I am getting the user name in PageLoad function by using this.User.Identity.Name and then storing the value in a hidden variable for aspx page. I am using this hidden  variable to display the name of the user. I am using Windows authentication for this. Now problem that I am getting is that when multiple user launch the application from different machine and if they click simultaneously, name of one user appears on the paged displayed on the machine of ot...

How to get the Mobilink Client user names in Update scripts
Hi all, i want to know how to get the Mobilink client UserName in the following Upload event scripts Upload_Update Upload_Insert Upload_Delete Upload_New_Row_Insert Upload_Old_Row_Insert Resolve_Conflict i need this keep track of who are all the client users have uploaded the data to the tables and also in conflict management process. I know how to get the Mobilink username in Download event scripts, there it will be passed as parameter to the respective download script with timestamp. But don't know how to access in the above Upload scripts please guide me thank...

get user name by user id
hi i send the user ID to a page and there i wanna find the user name. can you please let me know how to find a user name by user id? tanks  Are you using Active Directory? If so check out this tutorialCommunity Coder Hi you can pass the Guid USerId to Membership.GetUser method,MembershipUser usr = Membership.GetUser(UserIDAsGuid); string userName = usr.UserName; // to get the current logged in username , just use HttpContext.Current.User.Identity.Name;    Regards,Anas Ghanem.Note:Please Don't hesitate to click "Report Abuse" link if you noticed som...

Get the User Name for a login user
Hi Guys, How can I get the current loged in UserName in windows in MSSQL? The problem is: Users login into their PC (Windows Login) Enter a URL of the intranet application They would then be able to access the web base application (Intranet) The web application has a string connection to make a connection to the database I want to have a Trigger for my "products" table so if the table is modified (Insert/Update)  all those changes be entered in "products_Audit" table Now on "products_Audit" table I have a field "ChangedBy" where I want to store the windows loged...

How to get windows log-in user name using vb.net code?
Hi, I built an asp.net web application on our companies HR system so that recruitors can post jobs. Is there a way to get the windows logged in user name using vb.net code? This user name is using for tracking who posted the job. Thank you.   Windows Authentication provides some options, as does forms authentication.  See if you get what you need through User.Identity.Name.  Take a look at: http://www.15seconds.com/issue/020220.htmhttp://aspnet.4guysfromrolla.com/articles/120705-1.aspx JeffPlease: Don't forget to click "Mark as Answer" on the p...

Getting the user name of the currently logged in user
I'm writing my first custom module. Just as an experimental project I would just display information about the currently logged in user. I can get the User Id, but I don't know where to get the rest of the information. How do I get this? Hi, Just create a new UserController to get the information about one user via the method GetUser(PortalId, UserId) and store it into a UserInfo. Then you can get the rest of the information from this UserInfo [VB] Dim myUser As New UserInfo Dim myUserController As New UserController myUser = myUserController.GetUser(PortalId, Use...

Mining of a website to get the user names of its users
Hi, I have to do a application in which we have to trace  a website to get the user name of the uers in that website.Kindly give me idea or code to implement this.                                       Thanking you  If it's your website, I don't see why you would need to do this- you would know from the contents of your users database table. If it's not your own website, this is not c...

How to get user name or user ip address?
Hi to all! I have written a little survey application for our intranet. In order to prevent users from taking the survey a second (3rd, 4th, 5th...) time, the app should detect the user name, or the ip address of the session. Does someone know how to manage this with WebMatrix? Thanks! Bye, MichaelTo finish first, you first have to finish. Sure, you can use the Request object. Request.UserHostAddressStanley Tan theSpoke Blog Stanley, thanks! I searched the MSDN library. I found this article http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/h...

Separting the User name from the Machine name in User.Identity.Name
string userNameWithMachineName = User.Identity.Name; string userNameWithoutMachineName = System.IO.Path.GetFileName(userNameWithMachineName); HighOnCodingWanna get high! ...

Application User and still getting the logged in User Name
Hi I have a very intranet situation where User opens the Web Page Now here is calls a Database table where User Rights are stored But access to this database table is given to dbo and Application Uer which is created in IIS Server folder by clicking on Allow Anomymous Login=true when I try to run the Table Query and pass the USer Name I get null UserName how to deal with this situation   Thanks       so do you have anonymous access ON? try deny anonymous access to your application. Enable impersonation in your web.config./GuruBhai Hi, By default, ASP.N...

Web resources about - How to get client user name? - asp.net.security

Fat client - Wikipedia, the free encyclopedia
the name is contrasted to thin client , which describes a computer heavily dependent on a server's applications. A fat client still requires ...

Facebook Forms EMEA Client Council
Facebook announced the formation of its EMEA Client Council in a post in Spanish on the Facebook for Business page by vice president for Europe, ...

Facebook hires: Carsabi team, head of policy France, marketing mix science lead, client partners and ...
... Manager (Prineville) Chief Facility Engineer (Prineville) SMB Associate, French (Dublin) User Operations – Contract (Menlo Park) Client ...

Dropbox dumps popular email client Mailbox and photo service Carousel
Facing growing competitive pressures, Dropbox has dumped two of its flagship products, including smart email pioneer Mailbox.

Acquire Learning casts 'a very dark shadow' over its clients
The desperate and jobless are sold hope, but all they are buying is debt "You can hear it in how these clients talk," says a former call-centre ...

Never Complain To Clients Or Adversaries
Even trial lawyers that learn and have fun all the time deal with frustrations and have their gripes. But we should never share those gripes ...

Huge Creates New Global CMO, Client Services Roles
... Managing Directors Patricia Korth-McDonnell and Eric Moore into the newly created global roles of chief marketing officer and president-client ...

Dropbox is shutting down Mailbox, the popular email client
Dropbox acquired Mailbox, the extremely popular email client, way back in 2013, and unfortunately it's now time to say goodbye. That's right, ...

Chatting with coworkers, clients, friends and others is easy as Pie
... uses your companys domain). This also means that you can now set up teams to chat with people outside your company, including partners, clients, ...

Apple Says U.K. Surveillance Law Would Endanger All Clients
Apple Inc. outlined its opposition to a proposed U.K. surveillance law, saying threats to national security don’t justify weakening privacy and ...

Resources last updated: 12/31/2015 8:38:47 AM