This project has moved. For the latest updates, please go here.

How to expire the temporary password user has not Login Immediately after certain period in FBA

Oct 25, 2013 at 2:42 PM
Hi ,
i am using this solution, one able send the email to concern person after his completion of his registration process. what my requirement. if user does not change his immediately i need to expiry the temporary password which i sent to his mail
Oct 25, 2013 at 5:20 PM
I think the easiest solution would be to run some sql periodically on the aspnetdb database on sql server. You can schedule it with SQL Server Agent.

Something that checks the membership table if the created date is > 4 hours (or some period of time) from now, and if the password change date matches the created date, then set isapproved to 0.
Oct 29, 2013 at 1:01 PM
Edited Oct 29, 2013 at 1:33 PM
thanks for your Reply

i am check like this

update aspnet_Membership set IsApproved=0
where DATEDIFF(hh, GetDate(), LastPasswordChangedDate)>4 and

if the same user aging click on the forgot password link and generating the new password . he is not able to login. IsApproved is 0 . how can i make it it 1 when the user clicks agin forgot password links once his password expiration time
Oct 29, 2013 at 1:49 PM
You could customize the forgot password web part to unlock the user when it's used. Of course, in that case you should probably use IsLockedOut instead of IsApproved, to prevent users who are really supposed to be inactive from activatingt themselves.
Nov 11, 2013 at 3:34 AM
hi is there any alternate to Sql Job if we run the sql job there is some Performance issue . i am running some Stored procedure using Sql server Agent. but its looks like some performance can u tell any other approach we can do in code its self
Nov 11, 2013 at 4:23 AM
I guess you could retrieve all users in the code itself, and then loop through each user, checking for the last password change date, and then unapproving them in the code. The sql method should be faster though - I would think it should run nearly instantaneously, unless you have a ton of users.