ERROR
In high-availability ArcGIS Enterprise deployment, attempting to login to the Web Context URL portaladmin endpoint or WebAdaptor URL portaladmin endpoint fails, and the following error messages are returned:
Error java.lang.Exception: The server at 'https://server.domain:7443/arcgis/sharing/rest/oauth2/token' returned an error. code expired [] Code: 500
In a federated high-availability deployment of ArcGIS Enterprise with built-in authentication, security responsibilities are managed by the primary portal, which also oversees token generation for accessing various URLs. Consequently, attempting to access the portaladmin or serveradmin endpoint may result in a "Token Code Expired" error, attributable to time and time zone discrepancies relative to the primary Portal for ArcGIS machine.
The generated token has a set expiration period. However, due to differing time and time zone settings between the machines, the token expires prematurely.
Ensure uniform configuration of time and time zone across all machines engaged in a high-availability deployment. Administrator rights may be necessary to effect these adjustments.
Following the completion of changes, proceed to restart all machines.
Get help from ArcGIS experts
Download the Esri Support App