Class BackOfficeCookieManager
A custom cookie manager that is used to read the cookie from the request.
Inheritance
System.Object
Microsoft.AspNetCore.Authentication.Cookies.ChunkingCookieManager
Namespace: Umbraco.Cms.Web.BackOffice.Security
Assembly: Umbraco.Web.BackOffice.dll
Syntax
public class BackOfficeCookieManager : ChunkingCookieManager, ICookieManager
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
View SourceBackOfficeCookieManager(IUmbracoContextAccessor, IRuntimeState, Nullable<IEnumerable<String>>, UmbracoRequestPaths, IBasicAuthService)
Initializes a new instance of the BackOfficeCookieManager class.
Declaration
public BackOfficeCookieManager(IUmbracoContextAccessor umbracoContextAccessor, IRuntimeState runtime, IEnumerable<string>? explicitPaths, UmbracoRequestPaths umbracoRequestPaths, IBasicAuthService basicAuthService)
Parameters
Type | Name | Description |
---|---|---|
IUmbracoContextAccessor | umbracoContextAccessor | |
IRuntimeState | runtime | |
System.Nullable<IEnumerable<System.String>> | explicitPaths | |
UmbracoRequestPaths | umbracoRequestPaths | |
IBasicAuthService | basicAuthService |
BackOfficeCookieManager(IUmbracoContextAccessor, IRuntimeState, UmbracoRequestPaths, IBasicAuthService)
Initializes a new instance of the BackOfficeCookieManager class.
Declaration
public BackOfficeCookieManager(IUmbracoContextAccessor umbracoContextAccessor, IRuntimeState runtime, UmbracoRequestPaths umbracoRequestPaths, IBasicAuthService basicAuthService)
Parameters
Type | Name | Description |
---|---|---|
IUmbracoContextAccessor | umbracoContextAccessor | |
IRuntimeState | runtime | |
UmbracoRequestPaths | umbracoRequestPaths | |
IBasicAuthService | basicAuthService |
Methods
View SourceShouldAuthenticateRequest(String)
Determines if we should authenticate the request
Declaration
public bool ShouldAuthenticateRequest(string absPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | absPath |
Returns
Type | Description |
---|---|
System.Boolean | 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