ArcGIS.com no longer generates long-duration tokens; the maximum token duration is now two weeks. If you are using the version of the Maps and Apps Gallery that requires the token to be configured, we recommend that you convert the site to the latest version. The new version automatically generates the token as needed, which saves you the maintenance chore of keeping the token up-to-date.
The latest version is available from Esri's github site. Help for this conversion is available from Esri Support and the Local Government team.
Some background info; there are two important changes to the gallery:
The proxy.config file now holds the credentials to the ArcGIS.com gallery
The configuration file has been converted from JSON to JavaScript; this was done so that we could run it through a validator, which is very helpful for catching typographic errors
The gallery also comes with a web page called checklist.html which is useful for testing the various aspects of the configuration outside of the application itself.