Is there a light authentication in asp.net core?

mc 3,701 Reputation points
2021-05-24T09:39:28.837+00:00

There is a tag

    [Authorize]
    public class IndexModel : PageModel
    {
}

The [Authorize] I can add to the page class then I can not view the page if it is not authenticated.

How to add authentication ? that I can view the page?

I do not want to use Identity server.

and do not want to use ASP.NET Core Identity since it will generate tables .

I just want to verify the username and password and write authentication information to view the page.

thank you

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,216 questions
{count} votes

Accepted answer
  1. Yinqiu Yao-MSFT 236 Reputation points
    2021-05-26T07:13:35.927+00:00

    Hi @65841535 ,

    You can see the details in this article.

    And remember the middleware is

    app.UseAuthentication();  
    app.UseAuthorization();  
    

    They are indispensable and the order is also very important.


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful