Table of Contents

Class BackOfficeAntiforgery

Namespace
Umbraco.Cms.Web.BackOffice.Security
Assembly
Umbraco.Web.BackOffice.dll

Anti-forgery implementation for the Umbraco back office

public class BackOfficeAntiforgery : IBackOfficeAntiforgery
Inheritance
BackOfficeAntiforgery
Implements
Inherited Members

Remarks

This is a wrapper around the global/default IAntiforgery .net service. Because this service is a single/global object and all of it is internal we don't have the flexibility to create our own segregated service so we have to work around that limitation by wrapping the default and doing a few tricks to have this segregated for the Back office only.

Constructors

BackOfficeAntiforgery(IOptionsMonitor<GlobalSettings>)

[Obsolete("Please use the constructor that accepts ILoggerFactory. Will be removed in V14.")]
public BackOfficeAntiforgery(IOptionsMonitor<GlobalSettings> globalSettings)

Parameters

globalSettings IOptionsMonitor<GlobalSettings>

BackOfficeAntiforgery(IOptionsMonitor<GlobalSettings>, ILoggerFactory)

public BackOfficeAntiforgery(IOptionsMonitor<GlobalSettings> globalSettings, ILoggerFactory loggerFactory)

Parameters

globalSettings IOptionsMonitor<GlobalSettings>
loggerFactory ILoggerFactory

Methods

GetAndStoreTokens(HttpContext)

public void GetAndStoreTokens(HttpContext httpContext)

Parameters

httpContext HttpContext

ValidateRequestAsync(HttpContext)

public Task<Attempt<string?>> ValidateRequestAsync(HttpContext httpContext)

Parameters

httpContext HttpContext

Returns

Task<Attempt<string>>