You must Sign In to post a response.
  • Category: ASP.Net MVC

    Generate Reset token for password reset with time lifespan

    I have a target to achive send reset token with a time life span

    MVC application forget password by sending token with valid time,if time lapsed password will get expired how to get it done with the MVC 4 please guide me to achive it

    thanks in advance please help me out.

    Thanks
  • #768234
    Hi,

    This is basically depends on the version Entity Framework for token you have implemented.
    In version 2.0 we cant change the expiration which was default expiration is 1 days I guess.
    For version 3.0 we can able to change the expiration date I feel.

    Thanks,
    Mani

  • #768264
    ASP.NET Identity reset tokens based on existing user properties IUserTokenProvider , DataProtectorTokenProvider which is found in the Microsoft.AspNet.Identity.Owin package. Code snippet for IIdentityMessageService interface
    public class ApplicationUser : IdentityUser
    {
    public async Task<ClaimsIdentity> GenerateUserIdentityAsync(
    UserManager<ApplicationUser> manager)
    {

    var userIdentity = await manager.CreateIdentityAsync(this,
    DefaultAuthenticationTypes.ApplicationCookie);
    return userIdentity;
    }
    }


    Useful reference to Password recovery/reset code snippet : https://www.asp.net/identity/overview/features-api/account-confirmation-and-password-recovery-with-aspnet-identity


  • Sign In to post your comments