auth0-samples / auth0-aspnet-owin-mvc-samples

Quickstart and samples for ASP.NET (OWIN) MVC
MIT License
20 stars 93 forks source link

Duplicated code in Startup.cs? #44

Closed jausthalff closed 3 years ago

jausthalff commented 3 years ago

There seems to be duplicated lines in /Quickstart/01-Login/MvcApplication/MvcApplication/Startup.cs.

Lines 40 and 66 seem redundant and/or misplaced.

frederikprijck commented 3 years ago

The one is for the Cookie middleware, the other for the OpenIdConnect, see the links above each line:

app.UseCookieAuthentication(new CookieAuthenticationOptions
  {
      // More information on why the CookieManager needs to be set can be found here: 
      // https://github.com/aspnet/AspNetKatana/wiki/System.Web-response-cookie-integration-issues
      CookieManager = new SameSiteCookieManager(new SystemWebCookieManager())
  });

  app.UseOpenIdConnectAuthentication(new OpenIdConnectAuthenticationOptions
  {
      // More information on why the CookieManager needs to be set can be found here: 
      // https://docs.microsoft.com/en-us/aspnet/samesite/owin-samesite
      CookieManager = new SameSiteCookieManager(new SystemWebCookieManager()),
  )};