PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

Change a users password without knowing the old password nor the answer to the password question

 
 
AAaron123
Guest
Posts: n/a
 
      15th Jan 2009
I've been trying to create the capability of changing a users password
without knowing the old password nor the answer to the password question.

Without success!

I googled a few times, also without success.

I think I need a custom provider since the default one I use to create a
user account is:

<membership>
<providers>
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="LocalSqlServer" enablePasswordRetrieval="false"
enablePasswordReset="true" requiresQuestionAndAnswer="true"
applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed"
maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10"
passwordStrengthRegularExpression=""/>
</providers>
</membership>

Based on the note below I wonder if I could change the password if I knew
how to make a second AspNetSqlMembershipProvider in my solution and somehow
get ResetPassword to use it. Is something like that possible?

Maybe I need a folder with its own web.config file or a completly separate
application?

Can anyone give me a little direction or code ?

Thanks in advance for any help at all


In some organizations, a Customer Service department may wish to change a
user's password to a new known value, perhaps in response to a customer
request. The ChangePassword method, which appears to handle this need,
unfortunately requires the original user password which is usually
unavailable to the site administrator. By setting
"requiresQuestionAndAnswer" to false, "enablePasswordRetrieval" to true and
"enablePasswordReset" to true in web.config, the ResetPassword and
ChangePassword methods can be used to change a user's password to a known
value, regardless of the password format:


 
Reply With Quote
 
 
 
 
Oriane
Guest
Posts: n/a
 
      16th Jan 2009
Hi AAraon123,
"AAaron123" <(E-Mail Removed)> a écrit dans le message de
news:(E-Mail Removed)...
> I've been trying to create the capability of changing a users password
> without knowing the old password nor the answer to the password question.
>
> Without success!

I use this:
[WebMethod]
public string ResetPassword(string application, string userName)
{
Membership.ApplicationName = application;
if (Membership.EnablePasswordReset &&
!Membership.RequiresQuestionAndAnswer)
{
MembershipUser membershipUser =
Membership.GetUser(userName);
return membershipUser.ResetPassword();
}
return String.Empty;
}

with these settings:
<membership defaultProvider="MyProvider">
<providers>
<add connectionStringName="MyProvider" enablePasswordRetrieval="true"
enablePasswordReset="true" requiresQuestionAndAnswer="false"
applicationName="Stibil" name="MyProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</membership>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I change my password without knowing my old one? PJM Microsoft Outlook Discussion 5 19th Aug 2009 04:19 AM
Changing a users password without knowing the old password nor the answer to the password question AAaron123 Microsoft ASP .NET 2 16th Jan 2009 02:08 PM
How can Administrator change the Password of existing User, without knowing his Old Password in Administer Security Tool ? Luqman Microsoft ASP .NET 5 12th Jul 2007 10:29 AM
Users unable to reset password after password expiry. Sudeep Microsoft Windows 2000 Group Policy 2 21st Oct 2006 09:21 AM
Users prompted to change password/Password expiry hassanxyz@hotmail.com Microsoft Windows 2000 Group Policy 0 27th Oct 2003 07:31 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:14 AM.