Skip to content

Commit e326574

Browse files
authored
Add remark on opting out of authz
1 parent 7837139 commit e326574

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

aspnetcore/security/authentication/configure-oidc-web-authentication.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ builder.Services.AddAuthorizationBuilder()
158158
.SetFallbackPolicy(requireAuthPolicy);
159159
```
160160

161+
Opt out of authorization at public endpoints by applying the [`[AllowAnonymous]` attribute](xref:Microsoft.AspNetCore.Authorization.AllowAnonymousAttribute) to the public endpoints. For examples, see the [Add a new `Logout.cshtml` and `SignedOut.cshtml` Razor pages to the project](#add-a-new-logoutcshtml-and-signedoutcshtml-razor-pages-to-the-project) and [Implement `Login` page](#implement-login-page) sections.
162+
161163
### Add a new `Logout.cshtml` and `SignedOut.cshtml` Razor pages to the project
162164

163165
A logout is required to sign out both the cookie session and the OpenID Connect session. The whole app needs to redirect to the OpenID Connect server to sign out. After a successful sign out, the app opens the `RedirectUri` route.
@@ -194,7 +196,7 @@ public class SignedOutModel : PageModel
194196
}
195197
```
196198

197-
### Implement `Login` page
199+
### Implement `Login` page
198200

199201
A `Login` Razor page can also be implemented to call the `ChallengeAsync` directly with the required `AuthProperties`. This isn't required if the web app requires authentication and the default challenge is used.
200202

0 commit comments

Comments
 (0)