问题
I created a new ASP.NET Core MVC application with individual user accounts authentication. I would like to see how they implemented some methods. I suppose I can do it since ASP.NET Core is open source project, but I can't find these methods in github repository.
https://github.com/aspnet/AspNetCore/
I am highly interested in this method.
https://localhost:portnumber/Identity/Account/Login
Q1: How to find this method in my project and is it possible to debug it?
Q2: Why I dont see AccountController file in my new created app?
ANSWER: It turned out, that from .net core 2.2 version if you want to see or change Identity controllers, you have to scaffold them manually.
https://docs.microsoft.com/en-us/aspnet/core/security/authentication/scaffold-identity?view=aspnetcore-2.2&tabs=visual-studio#scaffold-identity-into-an-empty-project
回答1:
The methods you are referring to are part of your application. Have a look under the Areas folder. There should be a subfolder called Identity. Under the Identity folder, you should find the AccountController
and your Login
action method should be inside this controller.
If you really want to look into the source code you need to have a look at the SignInManager.cs class and see how the SignInAsync method is implemented, which is used by the Login
action method.
EDIT
Please refer to the screenshot below
EDIT 2
Structure for the newly created app using Web Application template
来源:https://stackoverflow.com/questions/55807277/how-to-inspect-asp-net-core-methods