Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 29th, 2004, 05:21 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default Membership Provider

Hey,

I am trying to specify an Encrypted password in the membership provider, but I get this error:

You must specify a non-autogenerated machine key to store password in the encrypted format. Either specify a different passwordFormat, or change machineKey configuration to use a non-autogenerated decryption key.

Here is the setup in web.config:

<membership defaultProvider="SQLProv">
            <providers>
                <add connectionStringName="webAdminConnection6322590945 95937500"
                    applicationName="/ASP2Sample" description="This is the sample provider."
                    requiresUniqueEmail="true" enablePasswordRetrieval="true"
                    enablePasswordReset="false" requiresQuestionAndAnswer="false"
                    passwordFormat="Encrypted" name="SQLProv" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
            </providers>
        </membership>

Where it says: passwordFormat="Encrypted", it doesn't like this. Any ideas?

Brian
__________________
Brian
 
Old September 7th, 2004, 10:06 AM
Registered User
 
Join Date: Sep 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I had the EXACT same problem. Look in the msdn help file index under "machineKey". It specifies what to do. In short,
in the web.config file, you have to specify some parameters for encryption to work. In the < system.web > node, add the following:

  < machineKey validationKey="[big long honkin key],IsolateApps"
decryptionKey="[other big honkin key],IsolateApps"
            validation="3DES" / >

These big long honkin keys can be generated. There is an msdn article that has a download regarding adding custom providers. You can download and install it from here: (http://download.microsoft.com/downlo...AMProvider.msi)
You can use the key gen exe to generate the correct size key you need based on the type of encryption you choose. For the validation key, i used 64 bytes. For the decryption key, i used 24 bytes (because I chose TripleDES).

Good luck!;)

 
Old September 7th, 2004, 02:33 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

I'll have to try that out. Thanks a lot.

Brian
 
Old September 8th, 2004, 04:21 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Yeah, that worked like a charm. Had trouble with SHA1 format, so I switched to 3DES.

Brian
 
Old April 13th, 2006, 04:10 PM
Registered User
 
Join Date: Apr 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I downloaded the link that was posted but how do you run the key gen exe in order to get a key?








Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Membership Provider Scott663 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 August 1st, 2008 05:16 PM
Custom Membership Provider kulkarnimonica ASP.NET 2.0 Professional 0 June 21st, 2007 03:56 PM
Membership Provider error jamara ASP.NET 2.0 Basics 1 March 12th, 2007 02:01 PM
Help with membership Provider... slim182 ASP.NET 2.0 Basics 1 February 19th, 2007 10:15 AM
membership provider davyquyo ASP.NET 2.0 Basics 0 January 1st, 2007 04:52 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.