4

i'm using ASP.NET MVC Core and i'm not using ASP.NET Identity.

Now i want to implement a email confirmation mechanism for the user's sign-in process.

The problem is that all the examples that i could find in the internet are using the "AspNetCore.Identity.UserManager" class with its

_userManager.GenerateEmailConfirmationTokenAsync(userId);

and

_userManager.ConfirmEmailAsync(userId, code);

methods for generating and checking the confirmation token.

Since i don't want to use Identity, ¿how can i implement "email confirmation" without Identity?

Thank you.

MorgoZ
  • 2,012
  • 5
  • 27
  • 54
  • 2
    The source code for *AspNetCore.Identity* is open source. You could simply review their source and used only what is applicable to you. Other than that, by trying to re-invent existing features, this question is now too broad to be fully address on this site. – Nkosi Nov 01 '18 at 16:02
  • 7
    The general steps are: 1) Add a columns to track whether the email is verified and one to store a token. 2) On signup generate a token (any way you like) and set it on the user record. 3) Send an email containing a link that includes this token (the email confirmation page). 4) On that page, look up the user, and verify that the token from the link matches the token from the record. 5) If they match, set email confirmed to true on the user record. If not, rinse and repeat. – Chris Pratt Nov 01 '18 at 16:14

0 Answers0