[Mono-dev] [CODE] Multi backend Membership/Role provider for ASP.NET 2.0

Marek Habersack grendel at caudium.net
Tue May 2 12:33:29 EDT 2006


Hello everybody,

  Some time ago I had the need to implement an ASP.NET 2.0 Membership/Role
provider that would work with XML files and after looking around the net, I
found out that there was nothing that would fit my needs. I started coding
what was needed and after a while I realized that the code could be
converted to provide an open architecture for various membership/role
providers, not just XML-backed ones. The result of the work can be found at
[1] and I would like to ask for the opinion of people on this mailing list
and also to propose its inclusion in Mono, if it passes the rigorous review
of the developers. I do realize that there is some resistance against
including new code that's not .Net compatible (as far as API compatibility
goes) in Mono, but let me present a few points that might speak in favor of
my proposal:

  - The release notes for Mono 1.1.15 mention that soon new Membership/Role
    providers will be available. Including the code would fill the gap
    almost immediately
  - The code is constructed in the way that minimizes code duplication.
    There is only one "frontend" provider class which supports multiple
    storage backends. The backends need to derive from an abstract class and
    implement its abstract members.
  - The frontend takes care of thread safety - backend is called with a
    mutex held. The mutex is application-wide and is shared accross all the
    backend instances (at most 2 of them - one owned by the Membership and
    the other by the Role provider). Therefore developers of the backends
    are freed from thinking about locking issues.

  I think that the code, after review and all the necessary bug fixes, would
serve well the Mono community making it easier to develop ASP.NET 2.0
applications.
  The tarball referenced below also includes a random password generator
class which was designed with the Membership GeneratePassword method in
mind. The PasswordGen class implements the algorithm found in the pwgen
program by Theodore T'so. Only the phoneme password generator is implemented
at the time, but the fully random one would probably generate passwords to
hard to remember by most human beings, so I left it out for the moment.
  Please let me know about your opinions, suggestions, constructive critics
regarding the code and I do hope it will be accepted in Mono :)

best regards,

marek

[1] http://grendel.thanes.org/mono/MembershipMultiProvider.tar.bz2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: Digital signature
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060502/8dd045b8/attachment.bin 


More information about the Mono-devel-list mailing list