Unable to Access REST Endpoint from Portal - "Token Required" Error

569
7
Jump to solution
01-30-2024 03:21 PM
Guinevere
New Contributor III

This is a recent issue that is occuring in our Enterprise.

When accessing the Services Rest Endpoint as Admin, or as any other user, I am not able to access it and get a blank white page with the URL changing to a Rest Login redirect.

To test I add ?f=json at the end of the REST URL and enter, I get the following Error:
{"error":{"code":499,"message":"Token Required","details":[]}}

When I manually generate a token and add it the Rest URL, I am then able to view the Rest Endpoint. But I am not able to navigate the Rest Endpoint as token does not carry over to any of the links and I must manually adjust the URL to get around.

As an Admin, this is inconvenient and annoying and we have no idea why this started happening.

Is there a setting or configuration that can be changed to fix this and allow sign-in admins quick access to the REST Endpoint again? 

 

UPDATE:
Further troubleshooting has show that we can access the root Rest Services Directory (https://domainname/arcgis/rest/services) and any of the services at this page level. 

BUT if I try to access any of the Folders, the link redirects to: https://domainname/arcigs/login/?returnUrl="https://domainname/arcgis/rest/services/foldername 

I have checked the permissions for folders via the Server Admin Directory and they are all set to "esriEVERYONE" and no one has been in their other than me and the other Admin and neither of us have changed any permissions to cause it to change automatically.

 

 

0 Kudos
1 Solution

Accepted Solutions
Guinevere
New Contributor III

UPDATE!!!

So we were able to figure out what was going on. It took some time, but we were able to get the browsers Developer Tools enabled and from the traffic we found that there was a CORS error being thrown when trying to access the REST EndPoint. 

To fix this we logged into our Portal and in the Settings we went to the "Allow Origins" section and added the REST EndPoint Domain URL to the list. This resolved the issue and we are now able to access the REST EndPoint without having to manually add the token any more.

I hope this resolution helps others who have a similar Problem.

View solution in original post

0 Kudos
7 Replies
hlindemann
New Contributor III

Hi @Guinevere , it might be that your federation is broken or misconfigured, can you review the following.

first go to 'https://yourdns.com/portal/portaladmin/federation/servers '
then select your server and validate your server

secondly go to "your disk letter:\arcgisserver\config-store\security\security-config.json"
review the JSON and make sure it matches the portal configuration, make sure the serverId matches this is important.

lastly have you tryed to access your admin through both the web adaptor and administrative url ?e.g.

https://yourdns.com/webadaptor/admin  and https://yourdns.com :6443/arcgis/admin

 

Hope it helps

Regards

Henry

0 Kudos
Guinevere
New Contributor III

Thanks for the suggestions. 

Our federation appears to be fine. I have checked the ServerID and it does match. Also, I am able to access the web adaptor and admin url just fine with no issues. So I don't think that is the problem.

0 Kudos
MiguelParedes
Esri Contributor

Greetings @Guinevere 

By "REST endpoint" I assume you mean the ArcGIS Server Services Directory, as in:
https://<server>.<domain>/<web_adaptor>/rest/services  or https://<server>.<domain>:6443/arcgis/rest/services is this the case?

Please, check The ArcGIS REST Services Directory page is unavailable in Portal for ArcGIS 

Let us know if the above helps.

Miguel
0 Kudos
Guinevere
New Contributor III

Yes, it is the ArcGIS REST Services Directory specifically that is the issue.

We were having issues with validating our DataStore which is mentioned in the article, but we have fixed the issue relating to that recently, but access to the REST services was still denied unless the token is manually added to the URL.
I will look into the other options in the article and let you know if any resolve the issue.

 

Thanks!

0 Kudos
Guinevere
New Contributor III

Following up on this.
I looked further into the article that was sent, and it did not resolve the issue.

I still get a blank page when I click on the View link to go to a services restendpoint.
The URL redirects to:

https://domainname/arcigs/login/?returnUrl="https://domainname/arcgis/rest/services/foldername"

It is not clear what is causing this.

0 Kudos
Mark24
by
New Contributor

I get the same issue, but it is only for a few folders not all. Our issue is on our nonprod REST end point, production is fine.

Have you had any luck getting to the bottom of this?

0 Kudos
Guinevere
New Contributor III

UPDATE!!!

So we were able to figure out what was going on. It took some time, but we were able to get the browsers Developer Tools enabled and from the traffic we found that there was a CORS error being thrown when trying to access the REST EndPoint. 

To fix this we logged into our Portal and in the Settings we went to the "Allow Origins" section and added the REST EndPoint Domain URL to the list. This resolved the issue and we are now able to access the REST EndPoint without having to manually add the token any more.

I hope this resolution helps others who have a similar Problem.

0 Kudos