다음을 통해 공유


IAuthenticationExtension.GetUserInfo Method

Returns the current user identity.

네임스페이스: Microsoft.ReportingServices.Interfaces
어셈블리: Microsoft.ReportingServices.Interfaces (in microsoft.reportingservices.interfaces.dll)

구문

‘선언
<StrongNameIdentityPermissionAttribute(SecurityAction.LinkDemand, PublicKey:="0024000004800000940000000602000000240000525341310004000001000100272736ad6e5f9586bac2d531eabc3acc666c2f8ec879fa94f8f7b0327d2ff2ed523448f83c3d5c5dd2dfc7bc99c5286b2c125117bf5cbe242b9d41750732b2bdffe649c6efb8e5526d526fdd130095ecdb7bf210809c6cdad8824faa9ac0310ac3cba2aa0523567b2dfa7fe250b30facbd62d4ec99b94ac47c7d3b28f1f6e4c8")> _
Sub GetUserInfo ( _
    <OutAttribute> ByRef userIdentity As IIdentity, _
    <OutAttribute> ByRef userId As IntPtr _
)
[StrongNameIdentityPermissionAttribute(SecurityAction.LinkDemand, PublicKey="0024000004800000940000000602000000240000525341310004000001000100272736ad6e5f9586bac2d531eabc3acc666c2f8ec879fa94f8f7b0327d2ff2ed523448f83c3d5c5dd2dfc7bc99c5286b2c125117bf5cbe242b9d41750732b2bdffe649c6efb8e5526d526fdd130095ecdb7bf210809c6cdad8824faa9ac0310ac3cba2aa0523567b2dfa7fe250b30facbd62d4ec99b94ac47c7d3b28f1f6e4c8")] 
void GetUserInfo (
    out IIdentity userIdentity,
    out IntPtr userId
)
[StrongNameIdentityPermissionAttribute(SecurityAction::LinkDemand, PublicKey=L"0024000004800000940000000602000000240000525341310004000001000100272736ad6e5f9586bac2d531eabc3acc666c2f8ec879fa94f8f7b0327d2ff2ed523448f83c3d5c5dd2dfc7bc99c5286b2c125117bf5cbe242b9d41750732b2bdffe649c6efb8e5526d526fdd130095ecdb7bf210809c6cdad8824faa9ac0310ac3cba2aa0523567b2dfa7fe250b30facbd62d4ec99b94ac47c7d3b28f1f6e4c8")] 
void GetUserInfo (
    [OutAttribute] IIdentity^% userIdentity, 
    [OutAttribute] IntPtr% userId
)
/** @attribute StrongNameIdentityPermissionAttribute(SecurityAction.LinkDemand, PublicKey="0024000004800000940000000602000000240000525341310004000001000100272736ad6e5f9586bac2d531eabc3acc666c2f8ec879fa94f8f7b0327d2ff2ed523448f83c3d5c5dd2dfc7bc99c5286b2c125117bf5cbe242b9d41750732b2bdffe649c6efb8e5526d526fdd130095ecdb7bf210809c6cdad8824faa9ac0310ac3cba2aa0523567b2dfa7fe250b30facbd62d4ec99b94ac47c7d3b28f1f6e4c8") */ 
void GetUserInfo (
    /** @attribute OutAttribute() */ /** @ref */ IIdentity userIdentity, 
    /** @attribute OutAttribute() */ /** @ref */ IntPtr userId
)
JScript는 값 유형 인수를 참조로 전달하는 것을 지원하지 않습니다.

매개 변수

  • userIdentity
    [out] The identity of the current user. The value of IIdentity may appear in a user interface and should be human readable.
  • userId
    [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 Sub GetUserInfo(ByRef userIdentity As IIdentity, ByRef userId As IntPtr)
   ' If the current user identity is not null,
   ' set the userIdentity parameter to that of the current user 
   If Not (HttpContext.Current Is Nothing) And Not (HttpContext.Current.User Is Nothing) Then
      userIdentity = HttpContext.Current.User.Identity
   Else
      userIdentity = Nothing
   End If 
   ' initialize a pointer to the current user id to zero
   userId = IntPtr.Zero
End Sub 'GetUserInfo
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;
   }
   else
      userIdentity = null;

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

스레드 보안

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

플랫폼

개발 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

대상 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

참고 항목

참조

IAuthenticationExtension Interface
IAuthenticationExtension Members
Microsoft.ReportingServices.Interfaces Namespace