Skip to content

Commit be33a6f

Browse files
serpent5Tratcher
authored andcommitted
Fixed suggestion re using AddCookie(s) for authz (#13869)
1 parent 64157c9 commit be33a6f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Http/Authentication.Core/src/AuthenticationService.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ private async Task<Exception> CreateMissingSignInHandlerException(string scheme)
253253
var schemes = await GetAllSignInSchemeNames();
254254

255255
// CookieAuth is the only implementation of sign-in.
256-
var footer = $" Did you forget to call AddAuthentication().AddCookies(\"{scheme}\",...)?";
256+
var footer = $" Did you forget to call AddAuthentication().AddCookie(\"{scheme}\",...)?";
257257

258258
if (string.IsNullOrEmpty(schemes))
259259
{
@@ -275,7 +275,7 @@ private async Task<Exception> CreateMismatchedSignInHandlerException(string sche
275275
{
276276
// CookieAuth is the only implementation of sign-in.
277277
return new InvalidOperationException(mismatchError
278-
+ $"Did you forget to call AddAuthentication().AddCookies(\"Cookies\") and SignInAsync(\"Cookies\",...)?");
278+
+ $"Did you forget to call AddAuthentication().AddCookie(\"Cookies\") and SignInAsync(\"Cookies\",...)?");
279279
}
280280

281281
return new InvalidOperationException(mismatchError + $"The registered sign-in schemes are: {schemes}.");
@@ -292,7 +292,7 @@ private async Task<Exception> CreateMissingSignOutHandlerException(string scheme
292292
{
293293
var schemes = await GetAllSignOutSchemeNames();
294294

295-
var footer = $" Did you forget to call AddAuthentication().AddCookies(\"{scheme}\",...)?";
295+
var footer = $" Did you forget to call AddAuthentication().AddCookie(\"{scheme}\",...)?";
296296

297297
if (string.IsNullOrEmpty(schemes))
298298
{
@@ -314,7 +314,7 @@ private async Task<Exception> CreateMismatchedSignOutHandlerException(string sch
314314
{
315315
// CookieAuth is the most common implementation of sign-out, but OpenIdConnect and WsFederation also support it.
316316
return new InvalidOperationException(mismatchError
317-
+ $"Did you forget to call AddAuthentication().AddCookies(\"Cookies\") and {nameof(SignOutAsync)}(\"Cookies\",...)?");
317+
+ $"Did you forget to call AddAuthentication().AddCookie(\"Cookies\") and {nameof(SignOutAsync)}(\"Cookies\",...)?");
318318
}
319319

320320
return new InvalidOperationException(mismatchError + $"The registered sign-out schemes are: {schemes}.");

0 commit comments

Comments
 (0)