View Source
Class HttpContextExtensions
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
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
View Source
SetExternalLoginProviderErrors(HttpContext, BackOfficeExternalLoginProviderErrors)
Declaration
public static void SetExternalLoginProviderErrors(this HttpContext httpContext, BackOfficeExternalLoginProviderErrors errors)
Parameters
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