You have a page in your application that should be accessible to both authenticated and non-authenticated users. How do you configure this in ASP.NET Core?
- Use [AllowAnonymous] attribute on the controller or action
- Create separate pages for authenticated and non-authenticated users
- Set up two different domains for each user type
- Use cookies to track user access
To make a page accessible to both authenticated and non-authenticated users in ASP.NET Core, you can use the [AllowAnonymous] attribute on the controller or action that corresponds to the page. This attribute allows both types of users to access the page without requiring authentication.
Loading...
Related Quiz
- To ensure a column is always populated in the database but its value is automatically generated on insert or update, you should configure it as a _________ property.
- Which tool would you use for building, running, and managing .NET applications without an IDE?
- While setting up an ASP.NET Core development environment on macOS, what would be the preferred installation method for the .NET SDK?
- The dotnet __________ command allows developers to run source code without previously compiling it.
- In a situation where you're building a single-page application (SPA) with a default index.html, which middleware ensures that the file is served when a user accesses the root URL?