I have the same problem - did any of the suggestions mentioned above help?
Refresh tokens expire after 12 hours using Microsoft Entra External ID native authentication with OTP
Issue
We chose Microsoft Entra External ID for authenticating external consumers using CIAM after reading this article
We're using these Android & iOS clients to signup and signin users with OTP authentication
In the backend we carefully followed the instructions to set up everything needed for the Native Authentication + OTP (one time passcode) user flow documented here.
We've run into an issue with the refresh tokens that we receive when using Native Authentication
Our expectation is that our refresh tokens should be valid for 90 days because we're using native apps which should fall under the 'other scenarios' in the following statement by microsoft documented for Entra ID:
The default lifetime for the refresh tokens is 24 hours for single page apps and 90 days for all other scenarios.
However our refresh tokens expire after 12 hours, which leads to a bad UX in our app due to forced repeated logins
AADSTS700082: The refresh token has expired due to inactivity. The token was issued on 2024-09-25T13:42:23.0482303Z and was inactive for 12:00:00.
2 answers
Sort by: Newest
-
-
James Hamil 25,481 Reputation points Microsoft Employee
Oct 2, 2024, 9:28 PM Hi @Niek Bijman , the default lifetime for refresh tokens in Azure AD B2C is 24 hours for single page apps and 90 days for all other scenarios, but there are other settings that can affect the lifetime of refresh tokens, such as
refresh_token_lifetime
androlling_refresh_token_lifetime
.Make sure that the
refresh_token_lifetime
policy setting is set to the default value of 90 days. (Policies > Properties > Token Lifetime Policy) and set the value to7776000
(90 days in seconds).Check that the
rolling_refresh_token_lifetime
policy setting is not set to a value that is less than 12 hours. This setting determines the maximum amount of time that a user can use a refresh token without having to reauthenticate. If this value is set to a value that is less than 12 hours, it could cause the refresh token to expire prematurely.Also verify that your app is using the correct scopes when requesting access tokens and refresh tokens. Make sure that you are requesting the
offline_access
scope when you authenticate the user. This is required to obtain a refresh token that can be used to obtain new access tokens without requiring the user to reauthenticate.Please let me know if you have any questions and I can help you further.
If this answer helps you please mark "Accept Answer" so other users can reference it.
Thank you,
James