Walter.BOM Namespace
Walter.Web.FireWall Namespace
ASP-WAF Web application firewall for .Net 6, .Net 5, .Net Standard 2.1 and .Net Core 3.x

CookieStoreBuilderExtensions Class

AllowRaiseIncident you to add a cookie-store to the firewall where the values stored in the cookies is replaced with values stored on disk or database

Namespace:  Microsoft.Extensions.DependencyInjection
Assembly:  Walter.Web.FireWall.CookieStore (in Walter.Web.FireWall.CookieStore.dll)

Syntax


public static class CookieStoreBuilderExtensions

Remarks


This extension method allows you to never store confidential data in the browser

Examples


Configure the application to use the cookie store
C#
services.AddFireWall(FireWallTrial.License, FireWallTrial.DomainKey
       , domainName: new Uri("https://www.your-domain.com", UriKind.Absolute)
       , options =>
       {
           options.Cypher.ApplicationPassword = "123456$even";
           options.ApplicationName = "Name as used for reporting";
           options.ApplicationTag = "ITIL Tag";
           options.Rules.BlockRequest.BlockDuration.SlideExpiration = true;
           options.Rules.BlockRequest.BlockDuration.Expires = TimeSpan.FromSeconds(10);

           //used by JavaScript in the browser
           options.WebServices.IsUserApiUrl = new Uri(Links.IsUserEndpoint, UriKind.Relative);
           options.WebServices.RegisterLinksApiUrl = new Uri(Links.SiteMapEndPoint, UriKind.Relative);
           options.WebServices.BeaconApiUrl = new Uri(Links.BeaconPoint, UriKind.Relative);

           options.Cookies.ConnectionString = Configuration.GetConnectionString("FireWallCookieDatabase");
       }).UseDBCookieStore();

   //protect each MVC controller
   services.AddMvc(options =>
       options.Filters.Add<Walter.Web.FireWall.Filters.FireWallFilter>()
   );

See Also


[Walter.Web.FireWall.IUserIdentity.WriteCookie(string, string, bool)]
[Walter.Web.FireWall.IUserIdentity.WriteCookie(string, string, TimeSpan, bool) ]
[Walter.Web.FireWall.IUserIdentity.WriteCookieAsync(string, string, TimeSpan, bool, System.Threading.CancellationToken) ]
[Walter.Web.FireWall.IUserIdentity.TryReadCookie(string, out string?)]