469,582 Members | 2,604 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,582 developers. It's quick & easy.

This Membership Provider has not been configured to support password retrieval.

Ben
Hi,

When an anonymous user has created an new account (with the CreateUserWizard
control), i want to let asp.net generate a password and to send it to the
address of the email provided by the new membershipuser in the
CreateUserWizard control.

i think i need to define a custom provider for membership and i tried this:

web.config:
-----------
<connectionStrings>
<add name="aspnetdb" connectionString="Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|\ASPNETDB.MDF;Integrated
Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
</connectionStrings>

<authentication mode="Forms" />

<membership>
<providers>
<add name="MyMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="aspnetdb"
enablePasswordRetrieval="true"
enablePasswordReset="true"
passwordFormat="Encrypted"
requiresQuestionAndAnswer="true"
applicationName="/"
/>
</providers>
</membership>
code-behind:
------------
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If User.Identity.IsAuthenticated Then
Dim pw As String
pw = Membership.GetUser.GetPassword.ToString
End If
End Sub
But this generate the error:
"This Membership Provider has not been configured to support password
retrieval."
at line "pw = Membership.GetUser.GetPassword.ToString"

The problem is, i think, that it still the default provider which is used
and not my custom one. But i don't knwo how to fix it.Maybe i don't even
need to defiine a custom provider and maybe i can use the default?

Thanks for help
Ben


Apr 16 '07 #1
1 14013
Ben
I changed this in web.config:

<membership defaultProvider="MyMembershipProvider">

but now, i get this error:
"You must specify a non-autogenerated machine key to store passwords in the
encrypted format. Either specify a different passwordFormat, or change the
machineKey configuration to use a non-autogenerated decryption key."

Do i have to change the line in web.config: passwordFormat="Encrypted" in
"Clear"? But then the security is not guaranteed?

"Ben" <b@en.sdschreef in bericht
news:Ov**************@TK2MSFTNGP04.phx.gbl...
Hi,

When an anonymous user has created an new account (with the
CreateUserWizard control), i want to let asp.net generate a password and
to send it to the address of the email provided by the new membershipuser
in the CreateUserWizard control.

i think i need to define a custom provider for membership and i tried
this:

web.config:
-----------
<connectionStrings>
<add name="aspnetdb" connectionString="Data
Source=.\SQLEXPRESS;AttachDbFilename=|DataDirector y|\ASPNETDB.MDF;Integrated
Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
</connectionStrings>

<authentication mode="Forms" />

<membership>
<providers>
<add name="MyMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="aspnetdb"
enablePasswordRetrieval="true"
enablePasswordReset="true"
passwordFormat="Encrypted"
requiresQuestionAndAnswer="true"
applicationName="/"
/>
</providers>
</membership>
code-behind:
------------
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If User.Identity.IsAuthenticated Then
Dim pw As String
pw = Membership.GetUser.GetPassword.ToString
End If
End Sub
But this generate the error:
"This Membership Provider has not been configured to support password
retrieval."
at line "pw = Membership.GetUser.GetPassword.ToString"

The problem is, i think, that it still the default provider which is used
and not my custom one. But i don't knwo how to fix it.Maybe i don't even
need to defiine a custom provider and maybe i can use the default?

Thanks for help
Ben


Apr 16 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Adam J Knight | last post: by
2 posts views Thread by Inverse | last post: by
3 posts views Thread by =?Utf-8?B?SGFyZHkgV2FuZw==?= | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.