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.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *