Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Http/Authentication.Core/src/AuthenticationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ private async Task<Exception> CreateMissingSignInHandlerException(string scheme)
var schemes = await GetAllSignInSchemeNames();

// 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))
{
Expand All @@ -275,7 +275,7 @@ private async Task<Exception> CreateMismatchedSignInHandlerException(string sche
{
// CookieAuth is the only implementation of sign-in.
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}.");
Expand All @@ -292,7 +292,7 @@ private async Task<Exception> CreateMissingSignOutHandlerException(string scheme
{
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))
{
Expand All @@ -314,7 +314,7 @@ private async Task<Exception> CreateMismatchedSignOutHandlerException(string sch
{
// CookieAuth is the most common implementation of sign-out, but OpenIdConnect and WsFederation also support it.
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}.");
Expand Down