From dcf39ad60157dbb1dcfc6d2be1375f10dcf04c68 Mon Sep 17 00:00:00 2001 From: Ryan O'Neill Date: Wed, 27 Sep 2017 15:05:58 +0100 Subject: [PATCH] Fix demo code for AddAuthentication.AddCookie In .Net Core 2.0 using the code as supplied results in an exception, the fix is to pass the scheme name when calling AddCookie. Fails: services.AddAuthentication("MyCookieAuthenticationScheme") .AddCookie Works: Fix demo code for services.AddAuthentication.AddCookie services.AddAuthentication("MyCookieAuthenticationScheme") .AddCookie("MyCookieAuthenticationScheme", --- aspnetcore/security/authentication/cookie.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/security/authentication/cookie.md b/aspnetcore/security/authentication/cookie.md index d964c0bfe0..5772966185 100644 --- a/aspnetcore/security/authentication/cookie.md +++ b/aspnetcore/security/authentication/cookie.md @@ -40,7 +40,7 @@ Complete the following steps: ```csharp services.AddAuthentication("MyCookieAuthenticationScheme") - .AddCookie(options => { + .AddCookie("MyCookieAuthenticationScheme", options => { options.AccessDeniedPath = "/Account/Forbidden/"; options.LoginPath = "/Account/Unauthorized/"; });