Configure Refresh Token Expiration (2024)

Refresh tokens can be a target for abuse if leaked because they can be used to acquire new access tokens. To mitigate this risk, Auth0 recommends using Automatic Reuse Detection and Refresh Token Rotation. Refresh Token Rotation issues a refresh token that expires after a preset lifetime. After expiration, the user gets a new refresh token in the same family, or refresh tokens that share a family ID, or a new access token/refresh token pair. To learn more, read Refresh Token Rotation.

You can enable and configure two refresh token lifetime settings, absolute and inactivity expiration, using either the Auth0 Dashboard or the Auth0 Management API. You can use a combination of absolute and inactivity expiration periods to create a balance between security and user experience that suits your business needs.

  • Absolute Lifetime: Set a refresh token or refresh token family lifetime after which the user must re-authenticate before being issued a new access token. If you disable this setting, the absolute lifetime will be indefinite.

  • Inactivity Lifetime: Set the inactivity lifetime of issued refresh tokens to expire if the user is not active in your application during a specified period.

Use the Dashboard

  1. Go to Dashboard > Applications.

  2. Select the application you want to configure.

  3. Go to the Settings tab.

  4. Under Refresh Token Expiration, enable Absolute Expiration. When enabled, a refresh token will expire based on an absolute lifetime, after which the token can no longer be used. If rotation is enabled, an expiration lifetime must be set.

    The Absolute Expiration of the rotating refresh token is defined on creation and is not changed, even with an exchange.

    Configure Refresh Token Expiration (1)
  5. Enter Absolute Lifetime in seconds. The refresh token expires after the specified interval and can no longer be used to get a new access token. When rotation is enabled, the absolute expiration also applies to the ability to get new tokens.

    Value
    Default2,592,000 seconds (30 days)
    Minimum1 second
    Maximum31,557,600 seconds (1 year)

    The calculation for 1 year is equivalent to 365.25 days to account for leap years.

  6. Enable Inactivity Expiration. When enabled, a refresh token will expire based on a specified inactivity lifetime, after which the token can no longer be used.

  7. Enter Inactivity Lifetime in seconds. If the refresh token is not exchanged within the specified interval, the refresh token expires and can no longer be used to get a new access token. The expiration period is renewed each time the refresh token is exchanged for a new access token within the interval.

    Value
    Minimum1 second
    Maximum31,557,600 seconds (1 year)
  8. Click Save Changes.

Use the Management API

You can configure the absolute and inactivity lifetime settings in the payload for the Management API /api/v2/clients/{id} endpoint. Here is an example that sets expiration lifetime for a non-rotating refresh token:

PATCH /api/v2/clients/{id}{ "refresh_token": { "rotation_type": "non-rotating", "expiration_type": "expiring", "token_lifetime": 2592000, "infinite_token_lifetime": false, "idle_token_lifetime": 604800, "infinite_idle_token_lifetime": false }}

Was this helpful?

/

Support and limitations

The OAuth BCP states that refresh tokens issued for browser-based applications must have an expiration and either enforce sender-constraint or rotate tokens with each request. Therefore, SPAs will default into rotation and will not support non-expiring refresh tokens.

Learn more

Configure Refresh Token Expiration (2024)

FAQs

Configure Refresh Token Expiration? ›

By default, access tokens are valid for 60 days and programmatic refresh tokens are valid for a year. The member must reauthorize your application when refresh tokens expire.

Should a refresh token have expiry? ›

By default, access tokens are valid for 60 days and programmatic refresh tokens are valid for a year. The member must reauthorize your application when refresh tokens expire.

How do you configure refresh token rotation? ›

Configure in the Dashboard

Select the application you want to configure. Go to the Settings tab. Under Refresh Token Rotation, enable Rotation. Enter Reuse Interval (in seconds) for the refresh token to account for leeway time between request and response before triggering automatic reuse detection.

How to change Azure token expiration time? ›

You can configure token lifetimes in the Azure portal. Go to the Azure portal. In "Azure Active Directory" > "Security" > "Authentication methods" > "Authentication methods blade" > "Token Lifetime Policies". you can configure the lifetime of access tokens, refresh tokens, and ID tokens.

Does Microsoft Refresh token expire? ›

The lifetime of a refresh token is set to 90 days by default and cannot be reduced or lengthened. However, you can configure the sign-in frequency in Conditional Access to define the time periods before a user is required to sign in again.

What is the best practice for refresh token length? ›

Best practice

Set the expiration time for refresh tokens in such a way that it is valid for a little longer period than the access tokens. For example, if you set 30 minutes for access token then set (at least) 24 hours for the refresh token.

How do I configure refresh token in Azure AD? ›

Go to Services > Applications > Azure Cloud Solution Provider > instance name > Configuration tab > Manage Refresh Token. In the Manual Update group, specify the authorization code that you received and click Update.

What is the lifetime of refresh token in Azure portal? ›

refresh_token_lifetime_secs Refresh token lifetimes (seconds). The default is 1,209,600 (14 days). The minimum is 86,400 (24 hours). The maximum is 7,776,000 (90 days).

What is the maximum inactive time for refresh token in Azure? ›

Refresh Token max inactive time is 90 days, if the user session continues it would renew without impacting the session but not when session controls are applied.

What is the refresh token policy? ›

The Refresh Token policy is evaluated only during usage of the issued refresh token and doesn't affect a user's current session. Refresh tokens are required only when a user's session has expired or isn't available. For example, you set a refresh token policy to expire the token after 1 hour.

How long does a primary refresh token last? ›

A PRT is valid for 90 days and is continuously renewed as long as the device is in use. However, it's only valid for 14 days if the device isn't in use. A PRT is only issued and renewed during native app authentication. A PRT isn't renewed or issued during a browser session.

Should refresh tokens be reused? ›

IdentityServer's refresh tokens can either be reusable or rotated. Reusable refresh tokens do exactly what they say on the tin: the client application uses and reuses the refresh token each time it needs a new access token. In contrast, rotated refresh tokens are only usable one time.

How long is the Apple refresh token good for? ›

Authorization code and refresh token validation requests require this parameter. To create this token, see Creating a client secret. The authorization code received in an authorization response sent to your app. The code is single-use only and valid for five minutes.

Do discord refresh tokens expire? ›

This is because the token is only valid for 7 days ( 604800 seconds to be precise). To prevent the user from having to re-authenticate you can implement an automatic refresh system.

Does Google refresh token expire? ›

The refresh token can be used to obtain a new access token when the current one expires, which can extend the expiration time of your authentication. Set a Longer Expiration Time: By default, Google Cloud API tokens expire after 1 hour.

How long should a JWT refresh token last? ›

When using the Org Authorization Server, the lifetime of the JSON Web Tokens (JWT) is hard-coded to the following values: ID Token: 60 minutes. Access Token: 60 minutes. Refresh Token: 90 days.

Top Articles
Using your debit card in Sweden: a complete cash, card, and ATM guide for your trip
Total Productive Maintenance (TPM) Effectiveness
DPhil Research - List of thesis titles
Palm Coast Permits Online
Hannaford Weekly Flyer Manchester Nh
craigslist: kenosha-racine jobs, apartments, for sale, services, community, and events
Voorraad - Foodtrailers
³µ¿Â«»ÍÀÇ Ã¢½ÃÀÚ À̸¸±¸ ¸íÀÎ, ¹Ì±¹ Ķ¸®Æ÷´Ï¾Æ ÁøÃâ - ¿ù°£ÆÄ¿öÄÚ¸®¾Æ
Directions To 401 East Chestnut Street Louisville Kentucky
Nikki Catsouras Head Cut In Half
How Far Is Chattanooga From Here
Best Cheap Action Camera
[PDF] INFORMATION BROCHURE - Free Download PDF
Oppenheimer Showtimes Near Cinemark Denton
Labor Gigs On Craigslist
Www Craigslist Com Phx
Diamond Piers Menards
Craigslist Missoula Atv
Tamilyogi Proxy
How to Watch the Fifty Shades Trilogy and Rom-Coms
Kashchey Vodka
Understanding Genetics
Pasco Telestaff
Winco Employee Handbook 2022
Jeffers Funeral Home Obituaries Greeneville Tennessee
Mini Handy 2024: Die besten Mini Smartphones | Purdroid.de
Apartments / Housing For Rent near Lake Placid, FL - craigslist
Receptionist Position Near Me
Co10 Unr
Christmas Days Away
Franklin Villafuerte Osorio
Brenda Song Wikifeet
Citibank Branch Locations In Orlando Florida
Sf Bay Area Craigslist Com
Junee Warehouse | Imamother
Jennifer Reimold Ex Husband Scott Porter
Naya Padkar Newspaper Today
Weapons Storehouse Nyt Crossword
Jewish Federation Of Greater Rochester
Shih Tzu dogs for sale in Ireland
Philadelphia Inquirer Obituaries This Week
5 Tips To Throw A Fun Halloween Party For Adults
Empires And Puzzles Dark Chest
Überblick zum Barotrauma - Überblick zum Barotrauma - MSD Manual Profi-Ausgabe
Fapello.clm
Gold Dipping Vat Terraria
'The Nun II' Ending Explained: Does the Immortal Valak Die This Time?
Brown launches digital hub to expand community, career exploration for students, alumni
Sacramentocraiglist
Waco.craigslist
Craigslist Cars And Trucks For Sale By Owner Indianapolis
Grace Charis Shagmag
Latest Posts
Article information

Author: Tyson Zemlak

Last Updated:

Views: 5771

Rating: 4.2 / 5 (43 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Tyson Zemlak

Birthday: 1992-03-17

Address: Apt. 662 96191 Quigley Dam, Kubview, MA 42013

Phone: +441678032891

Job: Community-Services Orchestrator

Hobby: Coffee roasting, Calligraphy, Metalworking, Fashion, Vehicle restoration, Shopping, Photography

Introduction: My name is Tyson Zemlak, I am a excited, light, sparkling, super, open, fair, magnificent person who loves writing and wants to share my knowledge and understanding with you.