ASP.NET membership password expiration

前端 未结 6 534
感动是毒
感动是毒 2021-01-30 14:24

I am using ASP.NET membership for the authentication of my web app. This worked great for me. I now have to implement password expiration.

If the password has expired th

6条回答
  •  被撕碎了的回忆
    2021-01-30 15:08

    Just implemented this in about an hour, no need to modify your base page. Heres what you have to do:

    1. Respond to the LoggingIn event of the membership control

    2. Find the user in the membership database and get LastPasswordChangedDate

    3. Using a TimeSpan, compare this with the current date and decide if the password was last changed more than the requisite number of days ago. I get this value from web.config

    4. If expired, redirect to the ChangePassword screen

提交回复
热议问题