简体   繁体   中英

Email confirmation and Password Policy Without ASP.NET Identity

I am using OWIN form authentication in my project and not using any Identity specific classes that MVC templates generate.

I want to implement email confirmation and a password policy in my project. I'm not sure how this can be accomplished, as I don't have Identity related classes in my project as I don't want to use those. I am happy with the OWIN form authentication.

Is there any way I can verify via email and create a password policy by using OWIN form authentication?

I am not expert but Yes you can , To verify Email address you can send email with Guid as QueryString and add page to check id Guid is true and then flag user as confirmed did you mean like this ?

     Send Email as html :
    body = "<b>Wellcom Mr " + Username + " </b>";
     body += "<br />";
     body += "<b><a href=http://YourDomain/checkuseremail.aspx?       
    UserId=" + userId + " style='display:block; '>confirm</a></b>";


     public partial class checkuseremail: System.Web.UI.Page
    {
   protected void Page_Load(object sender, EventArgs e)
    {
    string id = Request.QueryString["UserID"];
     if(id != null){ select user id if email correct redirct to success page  and flag user as confirmed} 

      else {redirct to error page}
     }}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM