Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Getting windows username using windows authentication???..............
Posted
Updated 12-Oct-12 1:59am
v7
Comments
I.explore.code 12-Oct-12 7:30am    
can you post your web.config content here?

EDIT: Actually this is not how you ask questions on here. You are expecting people to just "provide solution" rather than you trying yourself first and then coming here with specific questions.
I.explore.code 12-Oct-12 7:41am    
I am still not sure what do you want? you don't use both authentication schemes, you just use one. If you want the username of the logged on user, use Windows Authentication. If you want to allow access to any one, use Anonymous. Don't use both.
MT_ 12-Oct-12 7:53am    
what is the question Sir, If I may ask ?

1 solution

Once you have configured your app to use windows authentication, then just use this piece of code to get the Windows domain\username:

C#
HttpContext.Current.User.Identity.Name
 
Share this answer
 

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