IAuthenticationExtension.GetUserInfo Method (IIdentity, IntPtr)


Updated: February 25, 2016

Returns the current user identity.

Namespace:   Microsoft.ReportingServices.Interfaces
Assemblies:   Microsoft.ReportingServices.Interfaces (in Microsoft.ReportingServices.Interfaces.dll)
  Microsoft.ReportingServices.SharePoint.UI.WebParts (in Microsoft.ReportingServices.SharePoint.UI.WebParts.dll)

	PublicKey = "0024000004800000940000000602000000240000525341310004000001000100272736ad6e5f9586bac2d531eabc3acc666c2f8ec879fa94f8f7b0327d2ff2ed523448f83c3d5c5dd2dfc7bc99c5286b2c125117bf5cbe242b9d41750732b2bdffe649c6efb8e5526d526fdd130095ecdb7bf210809c6cdad8824faa9ac0310ac3cba2aa0523567b2dfa7fe250b30facbd62d4ec99b94ac47c7d3b28f1f6e4c8")]
void GetUserInfo(
	out IIdentity userIdentity,
	out IntPtr userId


Type: System.Security.Principal.IIdentity

[out] The identity of the current user. The value of IIdentity may appear in a user interface and should be human readable.

Type: System.IntPtr

[out] A user account token. This token is primarily used by the report server as a handle to a Windows account in support of credential management for Windows Authentication.

The report server calls the GetUserInfo method for each request to retrieve the current user identity.

The following example code implements the GetUserInfo method by returning the principal identity of the current HTTP request.

public void GetUserInfo(out IIdentity userIdentity, out IntPtr userId)
   // If the current user identity is not null,
   // set the userIdentity parameter to that of the current user 
   if (HttpContext.Current != null
       && HttpContext.Current.User != null)
       userIdentity = HttpContext.Current.User.Identity;
      userIdentity = null;

   // initialize a pointer to the current user id to zero
   userId = IntPtr.Zero;
Return to top