Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does an 'Account Activation' workflow exist for ASP.NET MVC

I need to implement the common 'New Account' pattern (in .net MVC) where:

  1. user information is collected;
  2. my system sends an email;
  3. and the user if required to reply to the email to activate the account.

Is there a best practices recognized or sample site that can guide my way?

thx much

EDIT: Note that i'm trying to drill into a deeper pattern here than just comparing a submitted password against a stored password.

Also please note that I'm not attempting any reference to Windows Workflow here. The title uses workflow in a generic sense only.

thx

like image 815
justSteve Avatar asked Jul 11 '09 11:07

justSteve


People also ask

What is authentication in ASP NET MVC?

Authentication. Authentication of user means verifying the identity of the user. This is really important. You might need to present your application only to the authenticated users for obvious reasons. Let's create a new ASP.Net MVC application.

Which class contains action methods that can register a new user and login the application?

Home Controller Class Contain two Action methods. First Action method is [HttpGet], when you run the application this method will execute. Second Action method is [HttpPost], when user clicks Create button this Action method will execute.


1 Answers

Implementing a Membership Provider

MSDN Membership Provider

Overriding a method, say the Create User Method

MSDN Membership.CreateUser()

All you need to do is inherit the AspNetMembershipProvider, override the CreateUser method and implement custom code:

public class MyNewMembershipProvider : AspNetMembershipProvider
{
        public override MembershipUser CreateUser(
            string username,
            string password,
            string email,
            string passwordQuestion,
            string passwordAnswer,
            bool isApproved,
            Object providerUserKey,
            out MembershipCreateStatus status)

            //Do whatever you need to do
            SendUserValidationMessage(emailAddress, responseMessage, 
                                      options, etc, whatever);

            return base.CreateUser(username, password, email, 
                                    passwordQuestion, passwordAnswer, 
                                    isApproved, providerUserKey, out status)
    }
}

I hope this helps. I think WF may be too much for something like this.

like image 194
Richard Clayton Avatar answered Oct 22 '22 02:10

Richard Clayton