I'm doing an authentication using cookies following the examples
Custom Authentication in ASP.Net-Core
Creating a simple login in ASP.NET Core 2 using Authentication and Authorization (NOT Identity)
I was able to do, already checking the data in the database, but I had a question, and I did not find the answer, how do I get the user data logged in after authentication?
I saw that in the code part below it stores some user data, so how do I get this data for example the user code to show only the records related to it?
identity.AddClaim(new Claim(ClaimTypes.NameIdentifier, loginData.Username));
identity.AddClaim(new Claim(ClaimTypes.Name, loginData.Username));
For example, on the user data editing page, you would need to get the values set in ClaimTypes.NameIdentifier and ClaimTypes.Name , how would you do it? or do I need to store this data in session?
Thank you!