Skip to content

Commit 293d1c0

Browse files
authored
Merge pull request #174 from AT-WH/master
Exposing Cookie name as a parameter.
2 parents 10dbdd6 + 43fbb4e commit 293d1c0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/SilkierQuartz/Authorization/SilkierQuartzAuthenticationOptions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,11 @@ public enum SimpleAccessRequirement
5757
/// Set to true to skip all requirement checks in <see cref="SilkierQuartzDefaultAuthorizationHandler"/>
5858
/// </summary>
5959
public bool SkipDefaultRequirementHandler { get; set; } = false;
60+
61+
/// <summary>
62+
/// Provide a name for CookieAuthenticationOptions.Cookie.Name field used to configure services.AddCookie.
63+
/// The value is only used when <see cref="SimpleAccessRequirement"/> is NOT set to <see cref="SimpleAccessRequirement.AllowAnonymous"/>
64+
/// </summary>
65+
public string CookieName { get; set; } = "sq_authenticationOptions.AuthScheme";
6066
}
6167
}

src/SilkierQuartz/Configuration/ServiceCollectionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static IServiceCollection AddSilkierQuartz(
3636
.AddAuthentication(authenticationOptions.AuthScheme)
3737
.AddCookie(authenticationOptions.AuthScheme, cfg =>
3838
{
39-
cfg.Cookie.Name = $"sq_authenticationOptions.AuthScheme";
39+
cfg.Cookie.Name = authenticationOptions.CookieName;
4040
cfg.Cookie.Path = options.VirtualPathRoot;
4141
cfg.LoginPath = $"{options.VirtualPathRoot}{(options.VirtualPathRoot.EndsWith('/') ? "" : "/")}Authenticate/Login";
4242
cfg.AccessDeniedPath = $"{options.VirtualPathRoot}{(options.VirtualPathRoot.EndsWith('/') ? "" : "/")}Authenticate/Login";

0 commit comments

Comments
 (0)