Search Results for

    Show / Hide Table of Contents
    View Source

    Class HttpContextExtensions

    Inheritance
    object
    Namespace: Umbraco.Extensions
    Assembly: Umbraco.Cms.Api.Management.dll
    Syntax
    public static class HttpContextExtensions

    Methods

    View Source

    AuthenticateBackOfficeAsync(HttpContext?)

    Runs the authentication process

    Declaration
    public static Task<AuthenticateResult> AuthenticateBackOfficeAsync(this HttpContext? httpContext)
    Parameters
    Type Name Description
    HttpContext httpContext
    Returns
    Type Description
    Task<AuthenticateResult>
    View Source

    GetCurrentIdentity(HttpContext)

    This will return the current back office identity.

    Declaration
    public static ClaimsIdentity? GetCurrentIdentity(this HttpContext http)
    Parameters
    Type Name Description
    HttpContext http
    Returns
    Type Description
    ClaimsIdentity

    Returns the current back office identity if an admin is authenticated otherwise null

    View Source

    GetExternalLoginProviderErrors(HttpContext)

    Declaration
    public static BackOfficeExternalLoginProviderErrors? GetExternalLoginProviderErrors(this HttpContext httpContext)
    Parameters
    Type Name Description
    HttpContext httpContext
    Returns
    Type Description
    BackOfficeExternalLoginProviderErrors
    View Source

    GetRequestValue(HttpContext, string)

    Get the value in the request form or query string for the key

    Declaration
    public static string? GetRequestValue(this HttpContext context, string key)
    Parameters
    Type Name Description
    HttpContext context
    string key
    Returns
    Type Description
    string
    View Source

    SetExternalLoginProviderErrors(HttpContext, BackOfficeExternalLoginProviderErrors)

    Declaration
    public static void SetExternalLoginProviderErrors(this HttpContext httpContext, BackOfficeExternalLoginProviderErrors errors)
    Parameters
    Type Name Description
    HttpContext httpContext
    BackOfficeExternalLoginProviderErrors errors
    View Source

    SetPrincipalForRequest(HttpContext, ClaimsPrincipal?)

    Declaration
    public static void SetPrincipalForRequest(this HttpContext context, ClaimsPrincipal? principal)
    Parameters
    Type Name Description
    HttpContext context
    ClaimsPrincipal principal
    View Source

    SetReasonPhrase(HttpContext, string?)

    Declaration
    public static void SetReasonPhrase(this HttpContext httpContext, string? reasonPhrase)
    Parameters
    Type Name Description
    HttpContext httpContext
    string reasonPhrase
    View Source

    TryGetBasicAuthCredentials(HttpContext, out string?, out string?)

    Try to get the basic auth username and password from the http context.

    Declaration
    public static bool TryGetBasicAuthCredentials(this HttpContext httpContext, out string? username, out string? password)
    Parameters
    Type Name Description
    HttpContext httpContext
    string username
    string password
    Returns
    Type Description
    bool
    • Edit this page
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX