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
userManagerIBackOfficeUserManagerruntimeStateIRuntimeStateruntimeMinifierIRuntimeMinifierglobalSettingsIOptionsSnapshot<GlobalSettings>hostingEnvironmentIHostingEnvironmenttextServiceILocalizedTextServicegridConfigIGridConfigbackOfficeServerVariablesBackOfficeServerVariablesappCachesAppCachessignInManagerIBackOfficeSignInManagerbackofficeSecurityAccessorIBackOfficeSecurityAccessorloggerILogger<BackOfficeController>jsonSerializerIJsonSerializerexternalLoginsIBackOfficeExternalLoginProvidershttpContextAccessorIHttpContextAccessorbackOfficeTwoFactorOptionsIBackOfficeTwoFactorOptionsmanifestParserIManifestParserserverVariablesServerVariablesParsersecuritySettingsIOptions<SecuritySettings>
Methods
Application()
Returns the JavaScript main file including all references found in manifests
[MinifyJavaScriptResult(Order = 0)]
[HttpGet]
[AllowAnonymous]
public Task<IActionResult> Application()
Returns
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
Default()
[HttpGet]
[AllowAnonymous]
public Task<IActionResult> Default()
Returns
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
Remarks
An example of this is here https://github.com/dotnet/aspnetcore/blob/main/src/Identity/samples/IdentitySample.Mvc/Controllers/AccountController.cs#L155 which this is based on
ExternalLogin(string, string?)
[HttpPost]
[AllowAnonymous]
public ActionResult ExternalLogin(string provider, string? redirectUrl = null)
Parameters
Returns
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
providerstring
Returns
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
culturestring
Returns
Login()
[HttpGet]
[AllowAnonymous]
public Task<IActionResult> Login()
Returns
ServerVariables()
Returns the JavaScript object representing the static server variables javascript object
[Authorize(Policy = "BackOfficeAccess")]
[MinifyJavaScriptResult(Order = 1)]
public Task<JavaScriptResult> ServerVariables()
Returns
ValidatePasswordResetCode(int, string)
[HttpGet]
[AllowAnonymous]
public Task<IActionResult> ValidatePasswordResetCode(int userId, string resetCode)
Parameters
Returns
VerifyInvite(string)
[HttpGet]
[AllowAnonymous]
public Task<IActionResult> VerifyInvite(string invite)
Parameters
invitestring