I'm developing a web application using Java EE 6 Web Profile. I want to e-mail a new user an activation link for his account. How should I implement this? I'm using JSF2. Is there any specification or recommended way for doing this?
I'm developing a web application using Java EE 6 Web Profile. I want to e-mail a new user an activation link for his account. How should I implement this? I'm using JSF2. Is there any specification or recommended way for doing this?
I have worked on a project that required user to confirm his email-id to activate his registration. The key generation process was like this:
Key Creation
verification_key
inusers
table that holds unique validation key for a user.verification_key
of that user. This will be unique (for practical purposes, I wouldn't go into probability of collision).so, bottom line,
key = Base64(Hash256(uniqueUserName+"."+password))
......
side note: BTW, nothing restricts you to use password as salt. You may just create an arbitrary string on fly as salt.
Verification
verification_key
is unique, get thekey
from request-parameter and find the matching row.verification_key
asnull
(this will also reduce chances of collision if any) and take user to "successfully-verified page".