About changing lifetime of refresh token

Phu Le 40 Reputation points
2023-02-27T11:12:38.6866667+00:00

Dear Microsoft Advertising API team,

I read the below article

You can't configure the lifetime of a refresh token. You can't reduce or lengthen their lifetime. Configure sign-in frequency in Conditional Access to define the time periods before a user is required to sign in again. https://learn.microsoft.com/EN-US/azure/active-directory/develop/refresh-tokens#token-timeouts

and executed following steps

  1. Go to my registered application
  2. Security > Conditional Access, create a policy
  3. In create new policy screen, section 「Session」, tick checkbox 「Sign-in frequency」and set-up Periodic reauthentication (1 hour)
  4. Authenticate my application througth Microsoft ads account to get refresh token
  5. Waiting for more than 1 hour with in-active refresh token User's image
  6. Use refresh token to create access token

Expected: get error that refresh token is expired

Actual: call request successfully→refresh token is still active

May I lack of any configuration ?

Thanks & Best regards

Phu

Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

Accepted answer
  1. Akshay-MSFT 17,951 Reputation points Microsoft Employee Moderator
    2023-03-01T11:24:04.81+00:00

    @Phu Le

    Thank you for your response. As per your policy screenshot you have opted for Sign in frequency- periodic reauthentication- after every on-hour, which means the user session will be revoked after an hour.

    User's image

    As per Refresh and session token lifetime policy properties

    After the retirement of refresh and session token configuration on January 30, 2021, Azure AD will only honor the default values described below. If you decide not to use Conditional Access to manage sign-in frequency, your refresh and session tokens will be set to the default configuration on that date and you'll no longer be able to change their lifetimes.

    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.

    User's image

    Please do let me know if you have any further queries in the comments section.

    Thanks,

    Akshay Kaushik

    Please "Accept the answer" (Yes/No), and share your feedback if the suggestion works as per your business need. This will help us and others in the community as well.


1 additional answer

Sort by: Most helpful
  1. Andy David - MVP 157.4K Reputation points MVP Volunteer Moderator
    2023-02-27T12:04:52.4066667+00:00

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.