'How can I set ID token lifetime for Azure AD?

I'm using MSAL for users to login my React app. The ID token will be created in Frontend and sent to Backend for authentication.

However I've found out the ID token expiration time is 1 hour. I'm afraid that the app will log out users while they are in middle of their process in form filling out. Where can I set the expiration time to max 24hrs in Azure portal?

I cannot find it in the doc, it only said set in console.



Solution 1:[1]

Where can I set the expiration time to max 24hrs in Azure portal?

You can configure the ID token lifetime for Azure AD through azure portal by following the below steps:

  1. Sign in to the Azure portal.
  2. Make sure you're using the directory that contains your Azure AD B2C tenant. Select the Directories + subscriptions icon in the portal toolbar.
  3. On the Portal settings | Directories + subscriptions page, find your Azure AD B2C directory in the Directory name list, and then select Switch.
  4. Choose All services in the top-left corner of the Azure portal, and then search for and select Azure AD B2C.
  5. Select User flows (policies).
  6. Open the user flow that you previously created.
  7. Select Properties.
  8. Under Token lifetime, adjust the property of ID token Lifetime of your application.
  9. Click Save.

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1