Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increase refresh token lifetime in B2C custom policy

Tags:

azure-ad-b2c

I am able to retrieve refresh tokens for my custom B2C policies but would like to increase the token lifetime to the max limit or set the sliding window lifetime to No Expiry.

This was able to be done via the Azure Portal B2C settings for Basic policies but is not available in the portal for custom policies.

https://learn.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-token-session-sso#token-lifetimes-configuration

How can I configure this in my policies?

like image 265
nyoung Avatar asked Oct 21 '25 15:10

nyoung


1 Answers

Check out this article.

Specifically add the following in your RP technical profile.

<Item Key="token_lifetime_secs">3600</Item>

Can look like this (copied from docs)

<ClaimsProviders>
   <ClaimsProvider>
      <DisplayName>Token Issuer</DisplayName>
      <TechnicalProfiles>
         <TechnicalProfile Id="JwtIssuer">
            <Metadata>
               <Item Key="token_lifetime_secs">3600</Item>
               <Item Key="id_token_lifetime_secs">3600</Item>
               <Item Key="refresh_token_lifetime_secs">1209600</Item>
               <Item Key="rolling_refresh_token_lifetime_secs">7776000</Item>
               <Item Key="IssuanceClaimPattern">AuthorityAndTenantGuid</Item>
               <Item Key="AuthenticationContextReferenceClaimPattern">None</Item>
            </Metadata>
         </TechnicalProfile>
      </TechnicalProfiles>
   </ClaimsProvider>
</ClaimsProviders>
like image 180
Parakh Avatar answered Oct 23 '25 14:10

Parakh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!