Reputation: 3761
I would like to implement an invitation system for an ASP.NET application. The system administration can add email addresses that are saved in the DB associated to a security key. This security key is sent to the e-mail in a link. When the user clicks the link it can register a new account and everything goes on.
I am a security newbie, so I would like to know if there are simple and secure (it will not be NASA archive, obviously) ways to implement a mechanism like that.
Thank you!
Upvotes: 2
Views: 1016
Reputation: 75578
I can think of two ways:
?Register.aspx?UserId=3&hmac=54oreijwgoro564i3j2o543
. Because the client can not reproduce the HMAC for another ID, he can not simply change the URL to register another user.?Register.aspx?Code=grewgkrwgoerwgrew432
, search the database for the row with that code. In some projects we use a guid as a random token, but I don't know how secure/random that is.Upvotes: 2