Search Results for

    Show / Hide Table of Contents
    View Source

    Class BackOfficeAntiforgery

    Antiforgery implementation for the Umbraco back office

    Inheritance
    System.Object
    Namespace: Umbraco.Cms.Web.BackOffice.Security
    Assembly: Umbraco.Web.BackOffice.dll
    Syntax
    public class BackOfficeAntiforgery : IBackOfficeAntiforgery
    Remarks

    This is a wrapper around the global/default Microsoft.AspNetCore.Antiforgery.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

    View Source

    BackOfficeAntiforgery(IOptionsMonitor<GlobalSettings>)

    Declaration
    public BackOfficeAntiforgery(IOptionsMonitor<GlobalSettings> globalSettings)
    Parameters
    Type Name Description
    Microsoft.Extensions.Options.IOptionsMonitor<GlobalSettings> globalSettings

    Methods

    View Source

    GetAndStoreTokens(HttpContext)

    Generates tokens to use for the cookie and header antiforgery values

    Declaration
    public void GetAndStoreTokens(HttpContext httpContext)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Http.HttpContext httpContext
    View Source

    ValidateRequestAsync(HttpContext)

    Validates the headers/cookies passed in for the request

    Declaration
    public async Task<Attempt<string>> ValidateRequestAsync(HttpContext httpContext)
    Parameters
    Type Name Description
    Microsoft.AspNetCore.Http.HttpContext httpContext
    Returns
    Type Description
    Task<Attempt<System.String>>
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • BackOfficeAntiforgery(IOptionsMonitor<GlobalSettings>)
    • Methods
      • GetAndStoreTokens(HttpContext)
      • ValidateRequestAsync(HttpContext)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX