Skip to content

Commit 9294b0f

Browse files
committed
Support configurable cookie security policy. Details in place.
1 parent 4546f60 commit 9294b0f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/ITfoxtec.Identity.Saml2.MvcCore/Configuration/Saml2ServiceCollectionExtensions.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ public static class Saml2ServiceCollectionExtensions
1414
/// <param name="slidingExpiration">If set to true the handler re-issue a new cookie with a new expiration time any time it processes a request which is more than halfway through the expiration window.</param>
1515
/// <param name="accessDeniedPath">If configured, access denied redirection target used by the handler.</param>
1616
/// <param name="sessionStore">Allow configuration of a custom ITicketStore.</param>
17-
public static IServiceCollection AddSaml2(this IServiceCollection services, string loginPath = "/Auth/Login", bool slidingExpiration = false, string accessDeniedPath = null, ITicketStore sessionStore = null, SameSiteMode cookieSameSite = SameSiteMode.Lax, string cookieDomain = null, CookieSecurePolicy cookieSecurePolicy = CookieSecurePolicy.None)
17+
/// <param name="cookieSameSite">The SameSite attribute of the cookie. The default value is Microsoft.AspNetCore.Http.SameSiteMode.Lax</param>
18+
/// <param name="cookieDomain">If configured, the domain to associate the cookie with.</param>
19+
/// <param name="cookieSecurePolicy">The cookie policy. The default value is Microsoft.AspNetCore.Http.CookieSecurePolicy.SameAsRequest.</param>
20+
public static IServiceCollection AddSaml2(this IServiceCollection services, string loginPath = "/Auth/Login", bool slidingExpiration = false, string accessDeniedPath = null, ITicketStore sessionStore = null, SameSiteMode cookieSameSite = SameSiteMode.Lax, string cookieDomain = null, CookieSecurePolicy cookieSecurePolicy = CookieSecurePolicy.SameAsRequest)
1821
{
1922
services.AddAuthentication(Saml2Constants.AuthenticationScheme)
2023
.AddCookie(Saml2Constants.AuthenticationScheme, o =>

0 commit comments

Comments
 (0)