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
globalSettingsIOptionsMonitor<GlobalSettings>
BackOfficeAntiforgery(IOptionsMonitor<GlobalSettings>, ILoggerFactory)
public BackOfficeAntiforgery(IOptionsMonitor<GlobalSettings> globalSettings, ILoggerFactory loggerFactory)
Parameters
globalSettingsIOptionsMonitor<GlobalSettings>loggerFactoryILoggerFactory
Methods
GetAndStoreTokens(HttpContext)
public void GetAndStoreTokens(HttpContext httpContext)
Parameters
httpContextHttpContext
ValidateRequestAsync(HttpContext)
public Task<Attempt<string?>> ValidateRequestAsync(HttpContext httpContext)
Parameters
httpContextHttpContext