A Razor attribute attaches framework-defined behavior to a component or page. On an online shop’s order-tracking page, an authorization attribute requires users to be authenticated before they can access the page. section 8.3
@attribute [Microsoft.AspNetCore.Authorization.Authorize]
Place this attribute in OrderTracking.razor to require authentication for the page. section 8.3
First, configure authentication and add authorization services. Run authentication and authorization middleware before endpoint registration. If an unauthenticated user opens the protected page, the middleware redirects them to the identity provider’s login page using the configured Authority; the page needs no redirect code. Product browsing can remain available without registration, while placing orders requires authentication. section 8.3
