Fixed suggestion re using AddCookie(s) for authz (#13869)

This commit is contained in:
Kirk Larkin 2019-09-11 16:09:20 +01:00 committed by Chris Ross
parent 64157c95c1
commit be33a6f392
1 changed files with 4 additions and 4 deletions

View File

@ -253,7 +253,7 @@ namespace Microsoft.AspNetCore.Authentication
var schemes = await GetAllSignInSchemeNames(); var schemes = await GetAllSignInSchemeNames();
// CookieAuth is the only implementation of sign-in. // CookieAuth is the only implementation of sign-in.
var footer = $" Did you forget to call AddAuthentication().AddCookies(\"{scheme}\",...)?"; var footer = $" Did you forget to call AddAuthentication().AddCookie(\"{scheme}\",...)?";
if (string.IsNullOrEmpty(schemes)) if (string.IsNullOrEmpty(schemes))
{ {
@ -275,7 +275,7 @@ namespace Microsoft.AspNetCore.Authentication
{ {
// CookieAuth is the only implementation of sign-in. // CookieAuth is the only implementation of sign-in.
return new InvalidOperationException(mismatchError return new InvalidOperationException(mismatchError
+ $"Did you forget to call AddAuthentication().AddCookies(\"Cookies\") and SignInAsync(\"Cookies\",...)?"); + $"Did you forget to call AddAuthentication().AddCookie(\"Cookies\") and SignInAsync(\"Cookies\",...)?");
} }
return new InvalidOperationException(mismatchError + $"The registered sign-in schemes are: {schemes}."); return new InvalidOperationException(mismatchError + $"The registered sign-in schemes are: {schemes}.");
@ -292,7 +292,7 @@ namespace Microsoft.AspNetCore.Authentication
{ {
var schemes = await GetAllSignOutSchemeNames(); var schemes = await GetAllSignOutSchemeNames();
var footer = $" Did you forget to call AddAuthentication().AddCookies(\"{scheme}\",...)?"; var footer = $" Did you forget to call AddAuthentication().AddCookie(\"{scheme}\",...)?";
if (string.IsNullOrEmpty(schemes)) if (string.IsNullOrEmpty(schemes))
{ {
@ -314,7 +314,7 @@ namespace Microsoft.AspNetCore.Authentication
{ {
// CookieAuth is the most common implementation of sign-out, but OpenIdConnect and WsFederation also support it. // CookieAuth is the most common implementation of sign-out, but OpenIdConnect and WsFederation also support it.
return new InvalidOperationException(mismatchError return new InvalidOperationException(mismatchError
+ $"Did you forget to call AddAuthentication().AddCookies(\"Cookies\") and {nameof(SignOutAsync)}(\"Cookies\",...)?"); + $"Did you forget to call AddAuthentication().AddCookie(\"Cookies\") and {nameof(SignOutAsync)}(\"Cookies\",...)?");
} }
return new InvalidOperationException(mismatchError + $"The registered sign-out schemes are: {schemes}."); return new InvalidOperationException(mismatchError + $"The registered sign-out schemes are: {schemes}.");