Upgrading ArcGIS Server federated with Portal for ArcGIS or accessing the Portal for ArcGIS homepage fails with the following error:
Error 400: Invalid redirect_uri
There are two scenarios that can lead to the error.
Scenario 1: Upgrading ArcGIS Server federated with Portal for ArcGIS
When upgrading a server federated with Portal for ArcGIS to a newer version, users must open the ArcGIS Server Manager (http://server.internaldomain.com:6080/arcgis/manager) and accept the prompt to continue the upgrade. In some cases, this process results in being redirected to the federated Portal for ArcGIS page. If Portal for ArcGIS does not have a whitelisted entry for the specified server page (server.internaldomain.com), the 400 error is returned. For more information, refer to the following web help document, Portal for ArcGIS: Federate an ArcGIS Server site with your portal.
Scenario 2: Accessing Portal for ArcGIS homepage
The error may occur due to a misconfiguration of a single Web Adaptor used for both Portal for ArcGIS and ArcGIS Server. The misconfiguration causes the web adaptor to register using an internal Fully Qualified Domain Name (FQDN). The Portal for ArcGIS homepage directs the site to the ArcGIS Server manager page, and returns the error.
Solution or Workaround
To resolve the error, use the following procedure according to the scenario involved:
Open /arcgis/portaladmin/security/oauth/getAppInfo?appID=arcgisonline&f=html in a web browser and record the JSON information from the Get App Info tool.
Open /arcgis/portaladmin/security/oauth/updateAppInfo, and add the copied JSON information into the App Info section.
Uninstall the web adaptor.
Reinstall the web adaptors for both Portal for ArcGIS and ArcGIS Server. For more information about configuring multiple ArcGIS Web Adaptors, refer to Configure multiple ArcGIS Web Adaptors.
Configure ArcGIS Web Adaptor for Portal for ArcGIS.
Manually edit the web adaptor to update the web adaptor URL, and direct it to the Portal for ArcGIS homepage.
Access the Portal Admin site.
Click System > Web Adaptors. This displays the name of the web adaptor.
Click the web adaptor name.
In the browser, append /edit to the URL. This redirects to the Edit Web Adaptor page.
Update the Web adaptor URL field to direct the page to the Portal for ArcGIS homepage.