ERROR

java.lang.Exception: The server at 'https://DOMAIN:7443/arcgis/sharing/rest/oauth2/token' returned an error. code expired [] Code: 500

Last Published: February 9, 2023

Error Message

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

Cause

In a federated high-availability ArcGIS Enterprise deployment with built-in authentication, security is handled by the primary portal. It also controls the token generation when accessing different URLs. In this case, when trying to access portaladmin or serveradmin endpoint gives Token Code Expired error due to time and time zone mismatch with respect to primary Portal for ArcGIS machine.

The token generated has an expiration period. Due to the difference in time and time zone, the token gets expired due to the time difference between the machines.

Solution or Workaround

Make sure all the machines involved in a high-availability deployment are configured with the same time and time zone. You may need administrator rights to make the changes.
Once the changes are done, restart all the machines.

Article ID:000029271

Software:
  • Portal for ArcGIS

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic