Brendan Tompkins

Sponsors

The Lounge

Wicked Cool Jobs

News

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Who do you think you are, anyway?

Sometimes simply knowing who you are can help a great deal.  I just figured out some tricky Active Directory permission issues by tracing out the current WindowsIdentity, like so:

  string strCurrentID = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
  System.Diagnostics.Trace.WriteLine("Current Impersonated Identity: " + strCurrentID );

Anyhow, I kept getting Unknown error (0x80005000).  Problem was, the current user didn't have the proper permissions to our AD store. From an ASP.NET application, this user is: NT AUTHORITY\NETWORK SERVICE.   I changed this to a more trusted account, by changing the anonymous user and password in the “Authentication Methods“ tab in the Directory Security tab of the site properties but I then remembered that I also had to adding the following to my web.config file.

  <identity impersonate="true"/>

Problem solved.

-Brendan

 


Posted Wed, Jan 28 2004 12:30 PM by Brendan Tompkins
Filed under:

[Advertisement]

Comments

Rob Walker wrote re: Who do you think you are, anyway?
on Wed, Jan 28 2004 9:04 AM
This is a must when working with active directory from an asp.net application.
Romualdas wrote re: Who do you think you are, anyway?
on Wed, Apr 28 2004 8:56 PM
And what about simple Page.User property?
Brendan Tompkins wrote re: Who do you think you are, anyway?
on Thu, Apr 29 2004 1:48 AM
Rom,

Not sure about Page.User, will this show you the current impersonated user? You really need the Windows Identity process in this case.

-B
graham cotter wrote re: Who do you think you are, anyway?
on Sun, Oct 17 2004 11:03 PM
Alright Lads,

Hopefully ye can help, i am the administrator of a sharepoint site (really i am the documentation guy and i ahve no idea how the hell i got landed with this but...) major problems, some users assigned to a group dont hve to login and others have admin rights. There are alot more issues than this but could ye help with even this..

Graham

ps: i am not a techie but all info will be appricated? grahamcotter@hotmail.com
Josh Pollard wrote re: Windows Authentication is the Bane of My Existence
on Wed, Nov 24 2004 1:03 AM

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Devlicio.us