Solved

Active Directory IIS needs to get user logged in from client not @ server

Posted on 2016-09-29
3
84 Views
Last Modified: 2016-09-30
Hi

I have an intranet site behind  a highly secure firewall.   I need to get the user at the client that is logged in

I am using this in c# in a web forms application

using System.DirectoryServices;
using System.DirectoryServices.AccountManagement;
using System.Security.Principal;
...
....
....
  String UserName = System.Security.Principal.WindowsIdentity.GetCurrent().Name;

It gives me the account of the server.  I need to get the username of the person logged in at the client.

How can I do this?  Any way to make it pass through from to IIS?  Maybe turn anonymous access off?

Thank You
0
Comment
Question by:Charles Baldo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 71

Assisted Solution

by:Chris Dent
Chris Dent earned 250 total points
ID: 41823097
Turning off anonymous access would be a good first step. Perhaps consider using Windows Integrated Authentication for your application.

Then you can use this to retrieve the user:
WindowsIdentity identity = HttpContext.Current.Request.LogonUserIdentity

Open in new window

Chris
0
 
LVL 33

Accepted Solution

by:
ste5an earned 250 total points
ID: 41823193
You need to activate impersonation:

- Using IIS Authentication with ASP.NET Impersonation
- Configure ASP.NET Impersonation Authentication (IIS 7)

Important: do this in collaboration with your domain and network administrator.
0
 

Author Closing Comment

by:Charles Baldo
ID: 41823347
Thank you both were neeeded
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question