Compartir a través de


ClaimsPrincipal.CreateFromHttpContext (Método, (HttpContext, Boolean))

Creates an IClaimsPrincipal from the httpContext.User.

Espacio de nombres: Microsoft.IdentityModel.Claims
Ensamblado: Microsoft.IdentityModel (en microsoft.identitymodel.dll)

Uso

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

returnValue = ClaimsPrincipal.CreateFromHttpContext(httpContext, clientCertificateAuthenticationEnabled)

Sintaxis

'Declaración
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

Parámetros

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

Valor devuelto

An IClaimsPrincipal.

Excepciones

Tipo de excepción Condición

Seguridad para subprocesos

Los miembros estáticos públicos (Shared en Visual Basic) de este tipo son seguros para subprocesos.No se garantiza que los miembros de instancias sean seguros para subprocesos.

Plataformas

Plataformas de desarrollo

Windows Server 2003, Windows Vista

Target Platforms

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

Vea también

Referencia

ClaimsPrincipal (Clase)
ClaimsPrincipal (Miembros)
Microsoft.IdentityModel.Claims (Espacio de nombres)