Class BackOfficeSessionIdValidator
Used to validate a cookie against a user's session id
Inheritance
Namespace: Umbraco.Cms.Web.BackOffice.Security
Assembly: Umbraco.Web.BackOffice.dll
Syntax
public class BackOfficeSessionIdValidator
Remarks
This uses another cookie to track the last checked time which is done for a few reasons: * We can't use the user's auth ticket to do this because we'd be re-issuing the auth ticket all of the time and it would never expire plus the auth ticket size is much larger than this small value * This will execute quite often (every minute per user) and in some cases there might be several requests that end up re-issuing the cookie so the cookie value should be small * We want to avoid the user lookup if it's not required so that will only happen when the time diff is great enough in the cookie
This is a scoped/request based object.
Constructors
View SourceBackOfficeSessionIdValidator(ISystemClock, IOptionsSnapshot<GlobalSettings>, IBackOfficeUserManager)
Initializes a new instance of the BackOfficeSessionIdValidator class.
Declaration
public BackOfficeSessionIdValidator(ISystemClock systemClock, IOptionsSnapshot<GlobalSettings> globalSettings, IBackOfficeUserManager userManager)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Authentication.ISystemClock | systemClock | |
Microsoft.Extensions.Options.IOptionsSnapshot<GlobalSettings> | globalSettings | |
IBackOfficeUserManager | userManager |
Fields
View SourceCookieName
Declaration
public const string CookieName = "UMB_UCONTEXT_C"
Field Value
Type | Description |
---|---|
System.String |
Methods
View SourceValidateSessionAsync(TimeSpan, CookieValidatePrincipalContext)
Declaration
public async Task ValidateSessionAsync(TimeSpan validateInterval, CookieValidatePrincipalContext context)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | validateInterval | |
Microsoft.AspNetCore.Authentication.Cookies.CookieValidatePrincipalContext | context |
Returns
Type | Description |
---|---|
Task |