As promised previously, I want to dig a little deeper into the requirements and discuss some solutions. This post is going to be about the security and membership. The relevant requirements are:
- There system will only allow access to members, i.e. no public access
- The system should be simple and that includes registration
- Registration and security should be self maintaining wherever possible
- Lost password handling must be automatic
There are standard patterns for login and registration and you really want the users to feel in familiar territory whilst starting out with your application in otherwise they are likely to give up and never return. Also I want new users to be up and running as soon as possible.
First I have some choices to make so lets start with login id. Personally I find it difficult to remember my user names, particularly if registered with lots of web sites. I tend to try and pick the same one but obviously if someone else is using it then I have to pick a different one or a variation. I think using an e-mail address as a login is much more memorable and the chances of a clash are near zero. We will need the e-mail address as part of the registration process anyway so using it as a login id removes the need for choosing an additional login name or providing additional registration pages dedicated to telling the user to pick another name because it already exists.
Next the password. This is usually a weak point in any security system and I believe the best approach is to make it easy and secure for users retrieve a forgotten password. This way you can urge them to pick a more complicated pass phrase without them worrying about forgetting it. I need to allow for long passwords so there should be at least 100 characters available. Whilst we are on the subject of passwords, I intend to only store a salted hash so retrieving a password will be impossible. Lost passwords mean that the user will have to recreate a new one. There are two ways I could do this: either by generating a new password and e-mailing the result to the user or sending a special "one time" link instead which, when clicked on, allows the user to set a new password. As e-mail will travel unencrypted I prefer the second approach because the user is forced to select a new password and the link will only work once.
Finally, the registration process. This one is a little more complicated because I know Laura already has a list of contact details she wishes upload to the site. This means that contacts may already exist before the relevant user registers. I'm not sure if Laura intends the users to edit any contact or only their own details (I must remember to ask). If it's the latter then I'll need some mechanism for tying up the user to the contact. I could get the user to type in their address at registration and match that to an existing contact but there too much room for error when you consider things like "street" can be written as "st." etc. What I shall probably do is some sort of fuzzy match based on the post code and any other digits in the address. More on that at a later date. One benefit of matching the user to an existing contact is I can automatically validate a registration request saving Laura from a manual step. Any non-matches will have to manually verified unless I can think of some cunning way around the problem.
Thats all for tonight. As it's my birthday I'm going for dinner with friends tomorrow so the next installment will be at the weekend.