?
Solved

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

Posted on 2016-09-29
3
Medium Priority
?
109 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 1000 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 35

Accepted Solution

by:
ste5an earned 1000 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.
Suggested Courses

777 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