|
YOUR FEEDBACK
|
TOP MICROSOFT .NET LINKS ASP.NET Jon Box's .NET Blog: ASP.NET Membership Provider and Different Servers
I'm working on an application where I built a custom membership provider because of custom database scheme requirement
By: Jon Box
Jan. 9, 2006 04:15 PM
ASP.NET Membership Provider and Different Servers
I'm working on an application where I built a custom membership provider because of custom database scheme requirement. My custom membership provider is using the hashed format for passwords and user answers. I've got that working and now want to deploy the new application including the new provider. Due to the encryption in ASP.NET being based on the MachineKey and wanting to share the data in development and early testing (ie. different web servers), I needed a MachineKey at the application level.Thanks to an article in the patterns & practices ASP.NET 2.0 Security How To's, I found a snippet that would generate the keys for me. I converted it to a Windows app so that I could just copy/paste the key into the Web.Config file in my development project. While doing that, I discovered a small buy in the array declaration in thier sample. It is corrected below. To use the code, make a VB.NET WinForm project, add a multiline textbox and a button, paste this code in, and run. I have made the code generate SHA1 for validation and AES for the decryption key. Now I can run against the database from my development machine or the clients development server. I can even copy the DB directly to my box for debugging purposes. Imports System Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Private Sub CreateMachineKeyConfig() Private Function GenRandomValues(ByVal len As Integer) As String Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click End Class MICROSOFT .NET LATEST STORIES
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
|
SYS-CON FEATURED WHITEPAPERS MOST READ THIS WEEK BREAKING NEWS FROM THE WIRES
|
|||||||||||||||||||||||||||||||||||