.NET Framework Class Library
WindowsIdentity..::.GetCurrent Method

Returns a WindowsIdentity object that represents the current Windows user.

Overload List

  NameDescription
Public methodStatic memberGetCurrent()()()Returns a WindowsIdentity object that represents the current Windows user.
Public methodStatic memberGetCurrent(Boolean)Returns a WindowsIdentity object that represents the Windows identity for either the thread or the process, depending on the value of the ifImpersonating parameter.
Public methodStatic memberGetCurrent(TokenAccessLevels)Returns a WindowsIdentity object that represents the current Windows user, using the specified desired token access level.
Top
See Also

Reference

Tags :


Community Content

David R. Henderson
Calling GetCurrent() in SharePoint code

In order to have sufficient permissions to call WindowsIdentity.GetCurrent( ) in SharePoint code, the application trust level must be set to WSS_Medium. This is done through changing the web.config file for the SharePoint application. (Typically resides in 'c:\Inetpub\wwwroot\wss\VirtualDirectories\80') Find the trust element and set the level attribute to WSS_Medium.

     <trust level="WSS_Medium" originUrl="" />

Once the change is made, you'll need to restart IIS.

Tags :

Page view tracker