<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D54z00007UgHXICA3Okta Classic EngineAuthenticationAnswered2022-03-09T21:13:44.000Z2022-03-08T01:19:04.000Z2022-03-09T21:13:44.000Z
How to know when will my refresh token expire?

Hi,

 

Is there a way to find out how long my refresh token will expire? I'm not able to find it in config or maybe I don't have enough permission. I found this article https://support.okta.com/help/s/question/0D51Y000063DY4tSAG/what-is-the-expiration-time-for-refresh-token?language=en_US. It looks like its configurable? Is there an API I can call to find out?


  • Thanks for posting.

     

    Refresh token lifetimes are managed through the Authorization Server access policy. The default value for the refresh token lifetime (refreshTokenLifetimeMinutes) for an Authorization Server actions object is Unlimited, but expires every seven days if it hasn't been used. When you use a refresh token with a SPA, make sure that you keep a short refresh token lifetime for better security.

     

    More information and how to configure it here:

    https://developer.okta.com/docs/guides/refresh-tokens/main/

     

     

    Let us know if this helps you.

     

     

    Daniela Chavarria.

    Okta Inc.

    Expand Post
    • Hi Daniela,

       

      Thanks for the answer. A quick follow up question. In case of refresh token expires, does `webAuthClient.sessionClient.isAuthenticated` return false? or we'll need to wait til we call `webAuthClient.sessionClient.refreshToken()` and get an exception from `onError` callback?

       

      Thanks

      Expand Post
  • Hi Bruce,

     

    When a token is created using an API flow a "expires_in" can be set to a specific number. 

     

    Here I attached a documentation link related to Okta APIs : 

    https://help.okta.com/en/prod/Content/Topics/Security/API.htm

     

    When a token has been inactive for more than 30 days it is revoked and cannot be used again. Tokens are also only valid if the user who created the token is also active. Tokens issued by deactivated users are rejected. If the user account is reactivated, the API token is accepted with no other action required. 

     

     Refresh tokens have normally a very long expiration times relative to access tokens. Because refresh tokens are more valuable than access tokens they are usually only issued via the OAuth “Authorization Code Grant” flow.

     

    Regards,

     

    Daniela Chavarria.

    Okta Inc.

    Expand Post
This question is closed.
Loading
How to know when will my refresh token expire?