From 830ead1b987aee50b99ec1f80be74742ef3a9e49 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 31 Jan 2025 22:09:01 +1300 Subject: [PATCH] Update configure-jwt-bearer-authentication.md --- .../authentication/configure-jwt-bearer-authentication.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/security/authentication/configure-jwt-bearer-authentication.md b/aspnetcore/security/authentication/configure-jwt-bearer-authentication.md index cebc9a8921cb..168f600bbebf 100644 --- a/aspnetcore/security/authentication/configure-jwt-bearer-authentication.md +++ b/aspnetcore/security/authentication/configure-jwt-bearer-authentication.md @@ -188,7 +188,7 @@ var requireAuthPolicy = new AuthorizationPolicyBuilder() .Build(); builder.Services.AddAuthorizationBuilder() - .SetFallbackPolicy(requireAuthPolicy); + .SetDefaultPolicy(requireAuthPolicy); ``` The [Authorize](/dotnet/api/microsoft.aspnetcore.authorization.authorizeattribute) attribute can also be used to force the authentication. If multiple schemes are used, the bearer scheme generally needs to be set as the default authentication scheme or specified via `[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme])`.