Skip to content

Commit 45488bc

Browse files
committed
Use system web cookie managers
1 parent 967cc79 commit 45488bc

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

TaskWebApp/App_Start/Startup.Auth.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using System.Security.Claims;
1313
using System.Threading.Tasks;
1414
using System.Web.Http;
15+
using Microsoft.Owin.Host.SystemWeb;
1516
using TaskWebApp.Utils;
1617

1718
namespace TaskWebApp
@@ -29,7 +30,11 @@ public void ConfigureAuth(IAppBuilder app)
2930

3031
app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);
3132

32-
app.UseCookieAuthentication(new CookieAuthenticationOptions());
33+
app.UseCookieAuthentication(new CookieAuthenticationOptions
34+
{
35+
// ASP.NET web host compatible cookie manager
36+
CookieManager = new SystemWebChunkingCookieManager()
37+
});
3338

3439
app.UseOpenIdConnectAuthentication(
3540
new OpenIdConnectAuthenticationOptions
@@ -58,7 +63,10 @@ public void ConfigureAuth(IAppBuilder app)
5863
},
5964

6065
// Specify the scope by appending all of the scopes requested into one string (separated by a blank space)
61-
Scope = $"openid profile offline_access {Globals.ReadTasksScope} {Globals.WriteTasksScope}"
66+
Scope = $"openid profile offline_access {Globals.ReadTasksScope} {Globals.WriteTasksScope}",
67+
68+
// ASP.NET web host compatible cookie manager
69+
CookieManager = new SystemWebCookieManager()
6270
}
6371
);
6472
}

0 commit comments

Comments
 (0)