473,778 Members | 2,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How reset password if not know old one

Using ASP.NET built in membership.

I'm creating an "admin interface" to my site.

Thru code, how can I reset someones password without knowing the old/current
one?
Jun 27 '08 #1
3 2005


"Cirene" <ci****@nowhere .comwrote in message
news:Oc******** *****@TK2MSFTNG P02.phx.gbl...
Using ASP.NET built in membership.

I'm creating an "admin interface" to my site.

Thru code, how can I reset someones password without knowing the
old/current one?
You don't need to know the old password if you use the Reset password
method, that takes the username and the security question answer.
Otherwise provide your own MembershipProvi der implementation. Just inherit
from the standard one and add your own method, ChangePassword, that does
what you need.

--

Joe Fawcett (MVP - XML)
http://joe.fawcett.name

Jun 27 '08 #2
On 25 May, 23:43, "Cirene" <cir...@nowhere .comwrote:
Using ASP.NET built in membership.

I'm creating an "admin interface" to my site.

Thru code, how can I reset someones password without knowing the old/current
one?
You can do it with the default membership provider.

There are a number of settings in web.config that will affect the
password regime (see example below). If EnablePasswordR eset is false
then the system will demand the old password or the security question
answer. Otherwise the ResetPassword() method can have no parameters
although it will supply an automatically generated new password that
you cannot choose.

If you wan't to set the password to something specific then it
requires two steps:

string AutoPassword= AMembershipUser .ResetPassword( );
AmembershipUser .ChangePassword (AutoPassword, "MyPreferredPas sword")

HTH

Appendix:

Extract from web.config where the ASP.NET tab in IIS manager dialog
has been used to override default settings:

<membership>
<providers>
<remove name="AspNetSql MembershipProvi der" />
<add connectionStrin gName="LocalSql Server"
enablePasswordR etrieval="false "
enablePasswordR eset="true" requiresQuestio nAndAnswer="tru e"
applicationName ="/" requiresUniqueE mail="false"
passwordFormat= "Hashed"
maxInvalidPassw ordAttempts="5" minRequiredPass wordLength="5"
minRequiredNona lphanumericChar acters="1"
passwordAttempt Window="10"
passwordStrengt hRegularExpress ion=""
name="AspNetSql MembershipProvi der"
type="System.We b.Security.SqlM embershipProvid er, System.Web,
Version=2.0.0.0 , Culture=neutral , PublicKeyToken= b03f5f7f11d50a3 a" />
</providers>
</membership>
Jun 27 '08 #3
Thanks so much!

"Stan" <go********@phi lhall.netwrote in message
news:fa******** *************** ***********@p25 g2000hsf.google groups.com...
On 25 May, 23:43, "Cirene" <cir...@nowhere .comwrote:
>Using ASP.NET built in membership.

I'm creating an "admin interface" to my site.

Thru code, how can I reset someones password without knowing the
old/current
one?

You can do it with the default membership provider.

There are a number of settings in web.config that will affect the
password regime (see example below). If EnablePasswordR eset is false
then the system will demand the old password or the security question
answer. Otherwise the ResetPassword() method can have no parameters
although it will supply an automatically generated new password that
you cannot choose.

If you wan't to set the password to something specific then it
requires two steps:

string AutoPassword= AMembershipUser .ResetPassword( );
AmembershipUser .ChangePassword (AutoPassword, "MyPreferredPas sword")

HTH

Appendix:

Extract from web.config where the ASP.NET tab in IIS manager dialog
has been used to override default settings:

<membership>
<providers>
<remove name="AspNetSql MembershipProvi der" />
<add connectionStrin gName="LocalSql Server"
enablePasswordR etrieval="false "
enablePasswordR eset="true" requiresQuestio nAndAnswer="tru e"
applicationName ="/" requiresUniqueE mail="false"
passwordFormat= "Hashed"
maxInvalidPassw ordAttempts="5" minRequiredPass wordLength="5"
minRequiredNona lphanumericChar acters="1"
passwordAttempt Window="10"
passwordStrengt hRegularExpress ion=""
name="AspNetSql MembershipProvi der"
type="System.We b.Security.SqlM embershipProvid er, System.Web,
Version=2.0.0.0 , Culture=neutral , PublicKeyToken= b03f5f7f11d50a3 a" />
</providers>
</membership>

Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2377
by: Ian | last post by:
Hi I know there are products out there that can do this like http://www.psynch.com/technology/ska.html What is the code that is used to Reset a Users password so the next time they logon to the domain they are promoted for a new password? I know the code will have to run under the Admin. That is fine I just need to know what the API is and how to use it.
0
1255
by: John Gossett | last post by:
I have written an application in vb.net to reset user passwords in active directory. If I run the application as a user with full contol of the AD object I can reset the password. If I run the application as a user with just reset password permission on the account I cannot reset the password and get an error about access denied. At the same time I can run Active Directory Users and Computers and reset the account password. Any...
0
2346
by: serkan | last post by:
Guys, I am trying to get this password reset functionality wor for me but I am not successful at all. Please somebody help me. I get "Your password could not be reset - please try again later" so I think the get_random_word function is not working right. Here are the scripts: This is the script after the user enters his/her userid. <?php require_once("bookmark_fns.php"); // creating short variable name $username = $_POST;
1
1540
by: Dabbler | last post by:
My password reset emails aren't getting through so I have two problems, getting the email to work and resetting the passwords from users who have already missed their reset email. My health emails are getting through which puzzles me. <system.net> <mailSettings> <smtp from="admin@mydomain.com" > <network host="mail.myhost.com" password="mypwd"
3
1699
by: john_c | last post by:
Using asp.net Membership, is there a way to detect a password reset so that next time the user logs in, you can send them to the password change page? Thanks.
6
9933
by: jarice1978 | last post by:
Hello, I have been scanning the internet for a few days now. That is not working. So now it is time to post! I have read a few other posts on here about authentication but they do not match exactly. We currently have an intranet app built in a mixture of asp and asp.net 1.1 and 2.0 written in VB .Net. We have a form where the user logs in and it authenticates against active directory successully in 2 ways: 1. The admin resets the...
2
13721
by: Homer | last post by:
Hi, I want to be able to reset a user's password and I do not want to use the PasswordRecovery control to reset and email it to the user. A while back, I thought I'd read an article that mentioned about resetting password using the Website Administration Tool. I could not find such option in WSAT. Please help! Thanks, Jon
2
3205
by: DarthPeePee | last post by:
Hello everyone. I am working on a Password Strength Meter and I am running into 1 problem that I would like to fix. When pressing the "Clear Password & Try Again" button, the password clears out of the text box, but the meter will stay at its current position until text is entered back into the textbox. Once text is re-entered, the meter will display the results again. I would like everything to reset when the button is pushed, but I...
7
3482
by: hotflash | last post by:
Hi All, I want to creat a script where I will allow user to reset their own password. I have tried different options but don't have any luck. Wonder what I want to do is kinda not valid or not. ResetLogin.asp (where user will have to enter their username, old password, and new password). <TR> <TH ALIGN=LEFT> <FONT FACE="HELVETICA,HELV,ARIAL" SIZE=2>&nbsp;&nbsp;User Name: </FONT></TH> <TD><INPUT CLASS="bluebox"...
0
9629
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9470
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10127
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9923
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7475
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4033
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3627
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2865
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.