ClaimsPrincipal.CreateFromHttpContext 方法 (HttpContext, Boolean)

Creates an IClaimsPrincipal from the httpContext.User.

命名空间: Microsoft.IdentityModel.Claims
程序集: Microsoft.IdentityModel(microsoft.identitymodel.dll 中)

用法

    Dim httpContext As HttpContext
Dim clientCertificateAuthenticationEnabled As Boolean
Dim returnValue As IClaimsPrincipal

returnValue = ClaimsPrincipal.CreateFromHttpContext(httpContext, clientCertificateAuthenticationEnabled)

语法

声明
Public Shared Function CreateFromHttpContext ( _
    httpContext As HttpContext, _
    clientCertificateAuthenticationEnabled As Boolean _
) As IClaimsPrincipal
public static IClaimsPrincipal CreateFromHttpContext (
    HttpContext httpContext,
    bool clientCertificateAuthenticationEnabled
)
public:
static IClaimsPrincipal^ CreateFromHttpContext (
    HttpContext^ httpContext, 
    bool clientCertificateAuthenticationEnabled
)
public static IClaimsPrincipal CreateFromHttpContext (
    HttpContext httpContext, 
    boolean clientCertificateAuthenticationEnabled
)
public static function CreateFromHttpContext (
    httpContext : HttpContext, 
    clientCertificateAuthenticationEnabled : boolean
) : IClaimsPrincipal

参数

  • httpContext
    The httpContext object.
  • clientCertificateAuthenticationEnabled
    A boolean value that indicates whether the client certificate (if present) in the httpContext must be authenticated.

返回值

An IClaimsPrincipal.

异常

异常类型 条件

线程安全

此类型的任何公共静态(在 Visual Basic 中为 Shared)成员都是线程安全的。但不能保证任何实例成员是线程安全的。

平台

开发平台

Windows Server 2003, Windows Vista

Target Platforms

Windows Server 2008, Windows Vista, Not tested on Windows XP

请参见

参考

ClaimsPrincipal 类
ClaimsPrincipal 成员
Microsoft.IdentityModel.Claims 命名空间