How to change the expiration time of the token generated in application developed using Web App Builder

02-05-2018 03:03 AM
New Contributor II

I have developed an app using Web App Builder developer Edition and I am trying to change the expiration time of the token in tokenUtils.js file as below 



 var oAuthInfo =;


        var oauthReturnUrl = window.location.protocol + "//" + +

         require.toUrl("jimu") + "/oauth-callback.html";

        //OAuth will lose 'persist' query parameter if set expiration to two weeks exectly.

        oAuthInfo = new OAuthInfo({

          appId: appId,

          //expiration: 14 * 24 * 60 - 1,

          expiration: 2,

          portalUrl: portalUrl,

          authNamespace: '/',

          popup: true,

          popupCallbackUrl: oauthReturnUrl





 But while checking the response of generated token request in network tab, I am getting the token value and expiration time as below


 Hence the token is not getting expired in 2 mins as desired.

0 Kudos
2 Replies
New Contributor II

Mayur Patel‌ Good morning. Did you find a solution to this problem? I need to do something similar.
Thank you

0 Kudos
New Contributor II

Mayur Patel‌ I just tested your solution and it works fine: my application asks to log back in and a new token is generated. Thanks!

0 Kudos