Click here to Skip to main content
15,891,683 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
hi master of .net over there,,,
i need help,,,
i create the application web using MV. Studio 2015 without "login form".

and then i put my application to the server A.
when i open using the computer client, i always get the current user of server.

i want to get the current user client.
please help me..

What I have tried:

this is my code :
VB
Dim user_id = System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString()


but always get the currentUser of Server, i don't need it. but i need userClient, not userServer.

please help me
Posted
Updated 14-Feb-17 0:39am
Comments
F-ES Sitecore 14-Feb-17 7:00am    
As suggested in Solution 1 you can only do this if you use Windows Authentication however that won't work over the internet so unless your client's server is in the same authentication domain as the client browsers this won't work.

1 solution

I hope you are looking for Intranet Site Using ASP.NET MVC , Windows Authentication[^]

string userid = HttpContext.User.Identity.Name; // use this to get the client userid
 
Share this answer
 
v2
Comments
bejos3519 14-Feb-17 7:04am    
still can not sir...
the return is nothing
Karthik_Mahalingam 14-Feb-17 7:07am    
enable windows authentication in web config.
bejos3519 14-Feb-17 7:08am    
how ?
i want to know
Karthik_Mahalingam 14-Feb-17 7:09am    
  <authentication mode="Windows" />
bejos3519 14-Feb-17 7:25am    
where is the parent tag ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900