Table of Contents

Class BackOfficeController

Namespace
Umbraco.Cms.Web.BackOffice.Controllers
Assembly
Umbraco.Web.BackOffice.dll
[UmbracoRequireHttps]
public class BackOfficeController : UmbracoController
Inheritance
BackOfficeController

Constructors

BackOfficeController(IBackOfficeUserManager, IRuntimeState, IRuntimeMinifier, IOptionsSnapshot<GlobalSettings>, IHostingEnvironment, ILocalizedTextService, IGridConfig, BackOfficeServerVariables, AppCaches, IBackOfficeSignInManager, IBackOfficeSecurityAccessor, ILogger<BackOfficeController>, IJsonSerializer, IBackOfficeExternalLoginProviders, IHttpContextAccessor, IBackOfficeTwoFactorOptions, IManifestParser, ServerVariablesParser, IOptions<SecuritySettings>)

[ActivatorUtilitiesConstructor]
public BackOfficeController(IBackOfficeUserManager userManager, IRuntimeState runtimeState, IRuntimeMinifier runtimeMinifier, IOptionsSnapshot<GlobalSettings> globalSettings, IHostingEnvironment hostingEnvironment, ILocalizedTextService textService, IGridConfig gridConfig, BackOfficeServerVariables backOfficeServerVariables, AppCaches appCaches, IBackOfficeSignInManager signInManager, IBackOfficeSecurityAccessor backofficeSecurityAccessor, ILogger<BackOfficeController> logger, IJsonSerializer jsonSerializer, IBackOfficeExternalLoginProviders externalLogins, IHttpContextAccessor httpContextAccessor, IBackOfficeTwoFactorOptions backOfficeTwoFactorOptions, IManifestParser manifestParser, ServerVariablesParser serverVariables, IOptions<SecuritySettings> securitySettings)

Parameters

userManager IBackOfficeUserManager
runtimeState IRuntimeState
runtimeMinifier IRuntimeMinifier
globalSettings IOptionsSnapshot<GlobalSettings>
hostingEnvironment IHostingEnvironment
textService ILocalizedTextService
gridConfig IGridConfig
backOfficeServerVariables BackOfficeServerVariables
appCaches AppCaches
signInManager IBackOfficeSignInManager
backofficeSecurityAccessor IBackOfficeSecurityAccessor
logger ILogger<BackOfficeController>
jsonSerializer IJsonSerializer
externalLogins IBackOfficeExternalLoginProviders
httpContextAccessor IHttpContextAccessor
backOfficeTwoFactorOptions IBackOfficeTwoFactorOptions
manifestParser IManifestParser
serverVariables ServerVariablesParser
securitySettings IOptions<SecuritySettings>

Methods

Application()

Returns the JavaScript main file including all references found in manifests

[MinifyJavaScriptResult(Order = 0)]
[HttpGet]
[AllowAnonymous]
public Task<IActionResult> Application()

Returns

Task<IActionResult>

AuthorizeUpgrade()

This Action is used by the installer when an upgrade is detected but the admin user is not logged in. We need to ensure the user is authenticated before the install takes place so we redirect here to show the standard login screen.

[HttpGet]
[AllowAnonymous]
public Task<IActionResult> AuthorizeUpgrade()

Returns

Task<IActionResult>

Default()

[HttpGet]
[AllowAnonymous]
public Task<IActionResult> Default()

Returns

Task<IActionResult>

DefaultView()

Returns the default view for the BackOffice

public ViewResult DefaultView()

Returns

ViewResult

The default view currently /umbraco/UmbracoBackOffice/Default.cshtml

ExternalLinkLoginCallback()

Callback path when the user initiates a link login request from the back office to the external provider from the LinkLogin(string) action

[Authorize(Policy = "BackOfficeAccess")]
[HttpGet]
public Task<IActionResult> ExternalLinkLoginCallback()

Returns

Task<IActionResult>

Remarks

ExternalLogin(string, string?)

[HttpPost]
[AllowAnonymous]
public ActionResult ExternalLogin(string provider, string? redirectUrl = null)

Parameters

provider string
redirectUrl string

Returns

ActionResult

GetGridConfig()

[Authorize(Policy = "BackOfficeAccess")]
[HttpGet]
public IEnumerable<IGridEditorConfig> GetGridConfig()

Returns

IEnumerable<IGridEditorConfig>

LinkLogin(string)

Called when a user links an external login provider in the back office

[Authorize(Policy = "BackOfficeAccess")]
[HttpPost]
public ActionResult LinkLogin(string provider)

Parameters

provider string

Returns

ActionResult

LocalizedText(string?)

Get the json localized text for a given culture or the culture for the current user

[HttpGet]
[AllowAnonymous]
public Task<Dictionary<string, Dictionary<string, string>>> LocalizedText(string? culture = null)

Parameters

culture string

Returns

Task<Dictionary<string, Dictionary<string, string>>>

Login()

[HttpGet]
[AllowAnonymous]
public Task<IActionResult> Login()

Returns

Task<IActionResult>

ServerVariables()

Returns the JavaScript object representing the static server variables javascript object

[Authorize(Policy = "BackOfficeAccess")]
[MinifyJavaScriptResult(Order = 1)]
public Task<JavaScriptResult> ServerVariables()

Returns

Task<JavaScriptResult>

ValidatePasswordResetCode(int, string)

[HttpGet]
[AllowAnonymous]
public Task<IActionResult> ValidatePasswordResetCode(int userId, string resetCode)

Parameters

userId int
resetCode string

Returns

Task<IActionResult>

VerifyInvite(string)

[HttpGet]
[AllowAnonymous]
public Task<IActionResult> VerifyInvite(string invite)

Parameters

invite string

Returns

Task<IActionResult>