The back office application is the user interface for Redakt, where your users manage the website's content and setup. The back office is an optional feature, although all web platforms will require the back office in one application or another. The back office application is installed as an optional NuGet package.
Typically, the back office module is used together with the Redakt Identity Server. The back office does not include a means for user authentication itself, and therefore a separate identity server is required to be able to use the back office. You should install the Redakt Identity Server alongside the back office unless you want to use a third-party or custom identity server instead.
Several other Redakt modules contain packages that extend the functionality of the back office application. If you are using those modules, you should install their back office package in your back office project as well.
Installation
Install the back office package with the NuGet package manager or the Package Manager Console.
PM> Install-Package Redakt.BackOffice
Service registration
Services for the back office module are registered automatically by the default services.AddRedakt()
call, so you don't have to register this module explicitly. Alternatively, if you prefer to register modules manually or need to pass configuration options, you can do so by calling services.AddRedakt(false)
instead to prevent automatic module registration. In that case, you have to register the module explicitly as follows.
Register back office module services in the ConfigureServices()
method of your project's Startup.cs
file by adding an AddBackOffice()
call to the Redakt builder instance. The order in which services are added to the Redakt builder is not important.
public void ConfigureServices(IServiceCollection services)
{
// ... framework and other services here
var builder = services.AddRedakt(false); // Pass false to prevent automatic registration of installed Redakt modules.
builder.AddIdentityServer(); // In most cases you will also configure the Redakt identity server in the same project.
builder.AddBackOffice(); // Optionally pass Action<RedaktBackOfficeOptions> parameter.
// ... other Redakt services
}
Configuration settings
The back office application can be configured through the appsettings.json
file. Any configuration that is not included in the appsettings.json
file will be set to its default values. Additionally, an Action<RedaktBackOfficeOptions>
configuration delegate may be passed to the AddBackOffice()
call. Configuration set through this delegate takes priority and overrides values in the appsettings.json
file.
{
"Redakt": {
"BackOffice": {
"Hostname": null,
"RootPath": "/redakt",
"RequireHttps": false
}
}
}
Hostname
from version 1.4.1
This is the hostname that the back office application will be served from. By default, this is set to null, which means the back office application will be served from any hostname that is configured for the server or app service. If you set this to a specific hostname, the back office application will only be served from that hostname, and other hosts will return a 404 not found error. This is normally used in conjuction with the Root Path setting to configure a single endpoint for the back office application.
Root Path
This is the relative URL off the hostname root that the back office application is served from. You can change this if the back office URL would conflict with your own website content.
If you are hosting the back office on a separate website and hostname, you could also set this to the website root (/), in which case the back office application will be available on the hostname root URL (f.e. https://redakt.mywebsite.com).
Require HTTPS
If set to true, the back office application will be available via a secure SSL connection only. Requests to unsecured URLs will not be handled and return a 404 not found result.
We strongly recommend enabling this setting and access the back office through a secure connection only! Insecure connections are vulnerable to man-in-the-middle attacks. Some external identity providers will only accept secure callback URLs.
Middleware registration
The back office requires its middleware to be inserted into the ASP.NET Core request pipeline. Add the middleware to the request pipeline in the Configure()
method of your project's Startup.cs
file. The order of adding middleware to the pipeline matters. The code snippet below shows the correct order in which to add Redakt middleware when you're also including the identity server and web rendering engine in this project.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
// ... other pipeline configuration here
// Redakt middleware registration
app.UseRedaktIdentityServer(); // Add identity server first.
app.UseRedaktBackOffice(); // Back office comes before page rendering.
app.UseRedaktPageRendering();
}