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
httpContext
HttpContext
Returns
GetCurrentIdentity(HttpContext)
This will return the current back office identity.
public static ClaimsIdentity? GetCurrentIdentity(this HttpContext http)
Parameters
http
HttpContext
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
context
HttpContextkey
string
Returns
SetPrincipalForRequest(HttpContext, ClaimsPrincipal?)
public static void SetPrincipalForRequest(this HttpContext context, ClaimsPrincipal? principal)
Parameters
context
HttpContextprincipal
ClaimsPrincipal
SetReasonPhrase(HttpContext, string?)
public static void SetReasonPhrase(this HttpContext httpContext, string? reasonPhrase)
Parameters
httpContext
HttpContextreasonPhrase
string
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
httpContext
HttpContextusername
stringpassword
string