Search Wiki:

Stop reinventing the wheel


This library is designed to host a number of views that are used by utilites, apps and alike all the time.

The most common example that led to this project was the login form. You always reimplement login forms and you always do it wrong (from a security point of view). The first version of this library consists of a login form that utilizes SecureString objects to handle the password and encrypt the data for storing between sessions.

Read about this library at my blog: http://alexduggleby.com/2008/03/05/a-reusable-secure-login-form/

Used libraries


The library uses a library of mine that provides some extension methods. Once that source is cleaned-up a little, I'll post it here too. For now only available as a binary in the project.

The form uses the SecureTextbox Control by Glavs (the dotDude of .net) that he published here: http://weblogs.asp.net/pglavich/archive/2006/10/29/Secure-TextBox-Updated.aspx.

Usage

LoginController _loginController = new LoginController();
_loginController.GetCredentials();
 
string _username = _loginController.Username;
char[] _password = _loginController.Password;
// _password needs to be zero'ed a.s.a.p. after usage

Easy, right? You just need to remember to zero out that char array that contains the password (set each char to 0) after you have used it.
Last edited Mar 6 2008 at 1:12 AM  by AlexDuggleby, version 4
Updating...
Page view tracker