auth0-samples / auth0-aspnetcore-mvc-samples

Auth0 Integration Samples for ASP.NET Core MVC Web Applications
https://auth0.com/docs/quickstart/webapp/aspnet-core
MIT License
152 stars 199 forks source link

Setting custom cookie options #85

Closed razzemans closed 1 year ago

razzemans commented 1 year ago

In relation to #84 I can see how using the SDK fixes passing additional parameters.

However, I need to be able to set some custom cookie options. What I need to do, for the sake of being backwards compatible to some related websites, is the following:

.AddCookie(cookieOptions =>
{
    cookieOptions.Cookie.Name = "ourCustomCookieName";
    cookieOptions.Cookie.SameSite = SameSiteMode.Unspecified;
    cookieOptions.TicketDataFormat = new CustomTicketDataFormat();
});

I don't see how it is possible using the SDK? Which was one of the main reasons why I worked around it, but I could be mistaken. If it is not possible, do I have no other option to implement it without the SDK? cc @frederikprijck

frederikprijck commented 1 year ago

See https://github.com/auth0/auth0-aspnetcore-authentication/issues/54#issuecomment-1036245697