title: How to secure a token link?
body: <p>I have set up a reset password token, as usual user can click a forgot password link and we send them a token link to reset their password, I want the token will be expired in 15 minutes and it can be used only once and forwarded email token can not be be used.</p>
  
  <p>how to do this in ASP NEt Core?</p>
  
  <pre><code>     services.Configure&lt;CookiePolicyOptions&gt;(options =&gt;
          {
              options.CheckConsentNeeded = context =&gt; true;
              options.MinimumSameSitePolicy = SameSiteMode.None;
          });
  
          services.AddDataProtection()
              .SetApplicationName(Security.Application_Name)
              .PersistKeysToFileSystem(new DirectoryInfo(Security.Key_Ring_Path));
  
          services.Configure&lt;DataProtectionTokenProviderOptions&gt;(options =&gt;
          options.TokenLifespan = TimeSpan.FromMinutes(15));
  </code></pre>