I am having a register form that user fill in, once the form fill in, the registration is postponed till the user recieve an email to check that his email is ok, then when he reply the email, the registration is fully proceed.
I would like also the process to be automatic, without the need for the user to entered any number ect, just the need for him to click on the email to confirm, and automatic on my side too.
I want the process to be available to some others task than the registration process as well if possible.
Do I need to do all way check/123456 with the 123456 generated or is there a better way to do, a component, nuget that can do the job ? you experiences return would be helpful
thanks
You appear to be on the right track.
I do a similar thing quite often. It isn’t generic since I do not need it but you can change that quite easily.
Once a user registers I send an activation e-mail that contains a link that when clicked navigates to something such as
http://domain/member/activate/idwhere the id is a GUID. That is all I need. I look up the member id and activate it. Chances of someone guessing a new member’s id are rather slim and even if they do it is very far from a train smash.From what I can tell you need something more generic and a bit more security. You could always create some key (like a new GUID) that you store along with the user and then the activation calls:
http://domain/member/activate/id?key={the guid}. You could even encrypt the key. But that is up to you.For something that can be re-used and is more generic you could create an activation component that contains a list of activation ids. But to then activate a specific type of entity (such as user registration or form validation) you would need to have a way to perform that on the back-end. For example, when you call
http://domain/activation/activate/idinternally is looks up the id and gets the type. The activation request is, of course, created when, e.g., your user registers. You would probably want to store some expiry/timeout since a user may never activate.For each type you could have an activation mechanism on the relevant controller:
member/activate/keyorformvalidation/activate/key. So when you activation controller receives a request to activate it has a list of routes conigured per type and the navigates to the relevant route to perform the ‘actual’ activation.Another option is to have an in-process component perform activation e.g.: an
IActivatorinterface implemented by aMemberActivatororFormValdationActivatorand then have anIActivatorProviderimplementation that gives you the relevant provider based on a type (.NET Type or a string type you provider — that’s up to you).You could even pass an
ActivationRequestCommandalong to a service bus endpoint if you are so inclined.So you have many options. HTH