views:

105

answers:

1

Edit:

I think I can boil it down to: I want to use windows authentication mode, but be able to get a list of users like you would with Membership.GetAllUsers().


I'm trying to develop a solution for use on an intranet, so all the users will be authenticated. I guess I'm looking for a best of both worlds solution.

Here's the gist (I'll edit later for clarification)

  • I want to use Windows authentication mode. But then Membership.GetUser() is null.
  • I need a consistent foreign key in my data to reference the authenticated user. Also I need to have the users email address for notifications; Windows auth doesn't provide this.
  • Any queries to ActiveDirectory will require impersonation of the WindowsIdentity. IT won't provide a "system" account for this use.

Are there any such examples or solutions which fit my needs?

A: 

When using Windows Authentication, System.Web.HttpContext.Current.User.Identity.Name will give you the user's name. As for the email address, are you using Exchange?

Scott Ewers
Yes. We are using exchange.
hometoast
But, More importantly I would need to maintain a key for use in the data tables.
hometoast