Hi,
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 = esriNS.id.findOAuthInfo(portalUrl);
if(!oAuthInfo){
var oauthReturnUrl = window.location.protocol + "//" + window.location.host +
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
});
esriNS.id.registerOAuthInfos([oAuthInfo]);
}
But while checking the response of generated token request in network tab, I am getting the token value and expiration time as below
{"token":"asdfghjk","expires":1518432766610,"ssl":false}
Hence the token is not getting expired in 2 mins as desired.
Mayur Patel Good morning. Did you find a solution to this problem? I need to do something similar.
Thank you
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!