Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • BTrigger 4 posts 94 karma points
    Nov 15, 2022 @ 16:43
    BTrigger
    0

    Forgot Password Reset Token Expiration

    Hi there,

    Is it possible to change the Reset Password token expiration time in Umbraco 10.1?

    The token is being generated like so:

     string token = await _memberManager.GeneratePasswordResetTokenAsync(user);
    

    Thanks in advance! Cheers

  • AbsolutelyN 89 posts 437 karma points
    Nov 15, 2022 @ 19:38
    AbsolutelyN
    100

    Looking for same thing but for back office. Answer seems to be in asp.net core generates tokens with its DataProtectionTokenProviders.

    If you add this line to Startup.cs then the token expires after 1 min. Issue is I think it will apply to all tokens so could affect ones that should be longer/shorter.

    public void ConfigureServices(IServiceCollection services)

            services.Configure<DataProtectionTokenProviderOptions>(opt =>
                                    opt.TokenLifespan = TimeSpan.FromMinutes(1);
    

    Just change it to FromDays(x)

  • BTrigger 4 posts 94 karma points
    Nov 18, 2022 @ 15:50
    BTrigger
    0

    Hi AbsolutelyN,

    Thanks! I don't have plans to add aditional tokens, so that might just work!

    Cheers!

Please Sign in or register to post replies

Write your reply to:

Draft