Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Email Confirmation with MVC 5 and Asp.net Identity

I have been searching, but have not found any documentation on how to implement Email confirmation with MVC 5 using the new ASP.net Identity. There does not seem to be any documentation on this topic (that I could find).

Has anyone solved this yet? I am very surprised that this is not included by default in the default MVC 5 project.

Any guidance is greatly appreciated.

Thank You

like image 306
John Avatar asked Oct 10 '13 12:10

John


People also ask

How do I log into MVC identity with email instead of UserName?

cs change the property Email to UserName , remove the [EmailAddress] annotation from there and change the [Display(Name = "Email")] to [Display(Name = "Login")] or something you want to display. If you want to keep Email property, then add UserName property to the same view model and make it as required.

How can send mail after registration with activation link in ASP.NET MVC?

For this, go to Models folder ->right-click -> Add -> New item -> ADO.NET Entity Data Model -> click Add -> select database first approach->click Next. Select "New Connection" and give the connection details, then select database -> click OK.


1 Answers

I have written a step-by-step article on how to add email confirmation when using ASP.NET Identity. You can get the source code here in the project folder AspNetIdentity\AspNetIdentityRefApp. I have also created a service layer that encapsulates ASP.NET Identity, making it easier to incorporate in new MVC 5 applications and mimics the WebSecurity API used by SimpleMembership. You can get that class library from AspNetIdentity\SimpleSecurity.AspNetIdentity There is also reference app for using this library in AspNetIdentity\SimpleSecurity.AspNetIdentity.RefApp. The class library and reference app also show how to implement password reset using a token and basic authentication on Web API's.

like image 157
Kevin Junghans Avatar answered Sep 20 '22 16:09

Kevin Junghans