• Home
  • Categories
  • Recent
  • Popular
  • Pricing
  • Contact us
  • Docs
  • Login
FusionAuth
  • Home
  • Categories
  • Recent
  • Popular
  • Pricing
  • Contact us
  • Docs
  • Login

Appropriate refresh token setting for rolling window?

Scheduled Pinned Locked Moved Unsolved
Q&A
2
5
756
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T
    theogravity-sb
    last edited by 28 Oct 2022, 22:42

    What is the appropriate setting to use regarding refresh token expiration and refresh token usage when you want the following:

    • The refresh token can only be used once; on refresh, a new refresh token is issued
    • The new refresh token has an updated expiration of "Refresh Token duration" instead of the former refresh token's expiration

    I'm using:

    Refresh Token expiration: Sliding window
    Refresh Token usage: One time use

    Would those be the correct settings?

    D 1 Reply Last reply 29 Oct 2022, 14:42 Reply Quote 1
    • D
      dan @theogravity-sb
      last edited by 29 Oct 2022, 14:42

      @theogravity-sb

      Hiya,

      I don't think you want 'sliding window' because that essentially gives a refresh token a new lifetime once you use it. From the docs:

      If ... the expiration is a sliding window, then if the refresh token is used at 1:55pm, it would then expire at 2:55pm. If it were then used at 2:50pm, it would expire at 3:50 pm.

      You want one time use, for sure. But you also want the "Refresh token expiration" to be set to "fixed".

      Hope that helps,
      Dan

      --
      FusionAuth - Auth for devs, built by devs.
      https://fusionauth.io

      1 Reply Last reply Reply Quote 0
      • T
        theogravity-sb
        last edited by 29 Oct 2022, 23:32

        So basically for fixed, the new token will have a reset exp date, while the old one will retain its existing one?

        D 1 Reply Last reply 30 Oct 2022, 13:51 Reply Quote 0
        • D
          dan @theogravity-sb
          last edited by 30 Oct 2022, 13:51

          @theogravity-sb

          Yup. Here's a scenario with fixed and one time use. Let's say that refresh tokens have a lifetime of 10 days.

          Refresh token A is issued on day 1 (there's a JWT along for the ride as well). It is usable until day 10.

          On day 9, the JWT and refresh token A are presented to FusionAuth. A new JWT and refresh token B are generated. Refresh token B is good until day 19 (10 days from when it was issued).

          Hope this helps.

          You might also be interested in these refresh token related issues in GitHub:

          • https://github.com/FusionAuth/fusionauth-issues/issues/1840
          • https://github.com/FusionAuth/fusionauth-issues/issues/1619
          • https://github.com/FusionAuth/fusionauth-issues/issues/1484

          --
          FusionAuth - Auth for devs, built by devs.
          https://fusionauth.io

          T 1 Reply Last reply 4 Nov 2022, 16:43 Reply Quote 0
          • T
            theogravity-sb @dan
            last edited by theogravity-sb 11 Apr 2022, 16:43 4 Nov 2022, 16:43

            @dan Thanks, this is the use-case I was expecting.

            1 Reply Last reply Reply Quote 1
            2 out of 5
            • First post
              2/5
              Last post