Class HttpContextExtensions
- Namespace
 - Umbraco.Extensions
 
- Assembly
 - Umbraco.Web.Common.dll
 
public static class HttpContextExtensions
  - Inheritance
 - 
      
      HttpContextExtensions
 
- Inherited Members
 
Methods
AuthenticateBackOfficeAsync(HttpContext?)
Runs the authentication process
public static Task<AuthenticateResult> AuthenticateBackOfficeAsync(this HttpContext? httpContext)
  Parameters
httpContextHttpContext
Returns
GetCurrentIdentity(HttpContext)
This will return the current back office identity.
public static ClaimsIdentity? GetCurrentIdentity(this HttpContext http)
  Parameters
httpHttpContext
Returns
- ClaimsIdentity
 Returns the current back office identity if an admin is authenticated otherwise null
GetRequestValue(HttpContext, string)
Get the value in the request form or query string for the key
public static string? GetRequestValue(this HttpContext context, string key)
  Parameters
contextHttpContextkeystring
Returns
SetPrincipalForRequest(HttpContext, ClaimsPrincipal?)
public static void SetPrincipalForRequest(this HttpContext context, ClaimsPrincipal? principal)
  Parameters
contextHttpContextprincipalClaimsPrincipal
SetReasonPhrase(HttpContext, string?)
public static void SetReasonPhrase(this HttpContext httpContext, string? reasonPhrase)
  Parameters
httpContextHttpContextreasonPhrasestring
TryGetBasicAuthCredentials(HttpContext, out string?, out string?)
Try to get the basic auth username and password from the http context.
public static bool TryGetBasicAuthCredentials(this HttpContext httpContext, out string? username, out string? password)
  Parameters
httpContextHttpContextusernamestringpasswordstring