Class BackOfficeCookieManager
- Namespace
- Umbraco.Cms.Web.BackOffice.Security
- Assembly
- Umbraco.Web.BackOffice.dll
A custom cookie manager that is used to read the cookie from the request.
public class BackOfficeCookieManager : ChunkingCookieManager, ICookieManager
- Inheritance
-
BackOfficeCookieManager
- Implements
- Inherited Members
Remarks
Umbraco's back office cookie needs to be read on two paths: /umbraco and /install, therefore we cannot just set the cookie path to be /umbraco, instead we'll specify our own cookie manager and return null if the request isn't for an acceptable path.
Constructors
BackOfficeCookieManager(IUmbracoContextAccessor, IRuntimeState, IEnumerable<string>?, UmbracoRequestPaths, IBasicAuthService)
Initializes a new instance of the BackOfficeCookieManager class.
public BackOfficeCookieManager(IUmbracoContextAccessor umbracoContextAccessor, IRuntimeState runtime, IEnumerable<string>? explicitPaths, UmbracoRequestPaths umbracoRequestPaths, IBasicAuthService basicAuthService)
Parameters
umbracoContextAccessorIUmbracoContextAccessorruntimeIRuntimeStateexplicitPathsIEnumerable<string>umbracoRequestPathsUmbracoRequestPathsbasicAuthServiceIBasicAuthService
BackOfficeCookieManager(IUmbracoContextAccessor, IRuntimeState, UmbracoRequestPaths, IBasicAuthService)
Initializes a new instance of the BackOfficeCookieManager class.
public BackOfficeCookieManager(IUmbracoContextAccessor umbracoContextAccessor, IRuntimeState runtime, UmbracoRequestPaths umbracoRequestPaths, IBasicAuthService basicAuthService)
Parameters
umbracoContextAccessorIUmbracoContextAccessorruntimeIRuntimeStateumbracoRequestPathsUmbracoRequestPathsbasicAuthServiceIBasicAuthService
Methods
ShouldAuthenticateRequest(string)
Determines if we should authenticate the request
public bool ShouldAuthenticateRequest(string absPath)
Parameters
absPathstring
Returns
- bool
true if the request should be authenticated
Remarks
We auth the request when:
- it is a back office request
- it is an installer request
- it is a preview request