Invalid redirect_uri - error 400

2667
4
07-19-2021 10:58 AM
BlueSky17
New Contributor III

I get an Invalid redirect_uri error while trying to access ArcGIS Server using IP address. If I replace the ip address with server name: https://servername.loc:6443/arcgis/rest/services I don't have a problem accessing the services.

However, if I type: http(s)://1.1.11.111/arcgis/rest/services - it still populates the list of folders that are in the server but once I click on the folder it will give an Invalid redirect_uri error. See attached snapshot.

Obviously, the redirect link from the folder structure using ip address is not pointing the right direction but unsure, how to fix it. We have the server federated with portal and webadaptor. 

Let me know please if someone came across similar error and was able to fix it. Thank you.

 

PS: We run ArcGIS Server 10.6.1

Tags (3)
0 Kudos
4 Replies
ChristopherPawlyszyn
Esri Contributor

In a federated ArcGIS Server site, the Portal for ArcGIS site that it is federated with takes over the control of the security of the site. This means that redirection to the OAuth2 endpoint for Portal will verify the redirect URI and make sure it's one of the recorded, allowed entries. In this case, only the Services and Admin URLs used during federation would be allowed URIs for secured services, otherwise any other DNS alias or the IP address will return the invalid redirect error message.

 

Are you having issues with accessing the REST Services page using the correct URLs?


-- Chris Pawlyszyn
0 Kudos
JonSwoveland
Occasional Contributor

I subscribed to this thread in hopes someone from esri would respond.  It would be really, really nice if Portal supported multiple allowed redirects in such cases.  I get a significant number of clients that want to access their arcgis server via multiple DNS aliases. Most commonly, this is for supporting both internal and external hostnames.

 

0 Kudos
BlueSky17
New Contributor III

Thank you for your reply. I made this work :).

0 Kudos
JonathanQuinn
Esri Notable Contributor

While there is a workflow to update the redirect_uri list@ChristopherPawlyszyn  is correct in that once federated, Portal only knows about two URLs for federated servers; the services URL and the administration URL. These are the only URLs that can be used to access Server Manager, (assuming the services URL is either only using a reverse proxy or load balancer, or in the event you're using the web adaptors, they have admin access enabled).

Updating the redirect_uri list likely won't help situations where you have multiple URLs you need to access services through, for federated servers at least.