Recent
Articles |
Model-Glue & URL Consistency Someone asked on the Model-Glue mailing list how to keep deal with keeping event handler names and URLs in views consistent, i.e., if they change an event handler name, how can they avoid having to change the string wherever it appears in links in their views.
Dot Net Questions: Xml Reader Class Xml reader and xml writer comes from namespace system.xml. These classes' help in getting data from xml documents, both of these classes are abstract base classes. The xml reader class helps in to get xml data in stream or xml documents. This class provides fast...
Truveo Shows Video Search Upgrades AOL's Truveo video search product should present developers and other users of the platform with better analytics and greater API performance. A trio of new and updated goodies from Truveo arrived online.
Spry, Apollo, & Remote XML Sources So this is probably a 'Duh' type post, but I was curious how Apollo and it's "open" web browser would handle remote AJAX requests. As you know (or hopefully know), when doing AJAX requests your browser can only request AJAX data from the same server. So consider...
Cf.Objective() - Recap Of Day One Keynote - Jason - History of CF, themes for Scorpio, a little bit of each theme. New disclosures: RSS support (), . More to come in sessions over the weekend. Skipped the next session - spent time with Mark Drew going over Project: Unity, helping him configure support for...
AJAX And Server Side Search I've blogged before (or at least think I have) about how to do client side filtering/searching of data with Spry. An example of this is the search at RIAForge. The concept is simple. Load your dataset. Then simply filter against this dataset. RIAForge lets you filter both on...
Why Is XQuery Important? The advent of wireless internet access has made web design a very complicated matter. Previously, all web browsers were created equal. HTML was the only language used to create web sites, and it was only possible to go online with a desktop PC. Since...
|
|
|
06.26.07
ASP.NET 2.0: XML Membership Provider
by
Mads Kristensen
ASP.NET ships with a SqlMembershipProvider and a ActiveDirectoryMembershipProvider that makes user authentication and authorization very easy to implement, but for some reason those are the only membership providers provided natively by ASP.NET 2.0.
So, what do you do when you don't want or can't use SQL Server or Active Directory for memberships? You have to build a custom membership provider that suits your needs.
That's exactly what I faced when I wanted an XML membership provider for a small web project. The only one I could find on the web was a very simple read-only xml provider from MSDN. I then changed it to be writable as well, so you can dynamically add new users among other things. I also encrypted the passwords so no one is able to make sense out of them when looking at the XML file.
It's plug n' play, it works and it makes user authentication ridiculously easy. Download the code at the bottom and dump the XmlMembershipProvider.cs class into the App_Code folder and the users.xml into the App_Data folder. Then write this in the web.config.
Now you have a membership provider that enables you to make use of the collection of built in authentication controls. You can also interact directly with the provider without using the built in controls. Here's an example of how to create a new user:
Even though you can access the provider programmatically, nothing beats the simplicity of the built in controls. To start using the XmlMembershipProvider, drag a CreateUserWizard to your webform and let the magic begin.
Download
XmlMembershipProvider.zip (3,45 KB)
About the Author:
Mads Kristensen currently works as a Senior Developer at Traceworks located
in Copenhagen, Denmark. Mads graduated from Copenhagen Technical Academy with a multimedia degree in
2003, but has been a professional developer since 2000. His main focus is on ASP.NET but is responsible for Winforms, Windows- and
web services in his daily work as well. A true .NET developer with great passion for the simple solution.
http://www.madskristensen.dk/
|