I am struggling with an issue relating to ArcGIS Server REST API. I believe we are running v 10.6.
My process is:
I have completed this exact process in my organisation's ArcGIS Online platform, with no issues. So I am very perplexed and frustrated that this isn't working .
My token request:
POST /arcgis/sharing/rest/oauth2/token?client_id=XXX&client_secret=XXX&grant_type=client_credentials HTTP/1.1
My query request:
GET /arcgis/rest/services/Hosted/<feature layer name>/FeatureServer/0/query?where=1=1&token=XXX&f=json&outFields=name,device_type
If I copy a token from my Chrome browser (f12 debug mode/network tab) I am able to make both requests successfully!!
I am 'admin' on our server and I own both the application and the feature layer.
Any help is appreciated.
**update I tried running the /registerApp endpoint (using a browser Token)
I get the following:
"message": "Unable to register app.",
I don't know what the purpose of the redirect_uris attribute is; I have tried <domain>:<port> and urn:ietf:wg:oauth:2.0:oob to no effect.
Hi Jack Silburn, Can you provide more information on what you are trying to do after you have receive the token? Are you trying to create a web application and provide some sort of authentication mechanism? Have you consider using the ArcGIS JS IdentityManager?
The redirect_uri is a list of valid URI that is allowed for redirecting when user have successfully login
For example if you look at
and their live example
when you click on sign in, you will see it redirect the user to the login page for AGOL. IN the request you will see the redirect_uri telling AGOL once the user have successfully signed in, redirect the user back to the redirect_uri link.
This link HAS TO BE valid and added in your app registration
I am trying to enable my program to automatically update a feature layer (hosted on ArcGIS Server).
From my understanding, and past implementation with ArcGIS Online, I should simply need to:
This appears to be the same issue experienced by these users:
The approach to authenticating REST API requests in AGOL vs ArcGIS Server seems to be different - despite referencing the same documentation. At least in my opinion.
I didn't have to bother with 'redirect URIs' at all with my AGOL implementation.
Did you ever find a solution to this I have a python script that mines my REST endpoint that has been completely stopped because of this error. Any ideas on how to solve this?
From memory, I made the Feature Service 'visible to everyone' and edit permission enabled. This removed the requirement to authenticate requests to the server.
I justified this approach because:
In the future I would definitely need Auth.
Did you have any luck yourself?
Seems to be a popular question on the form, and not a single answer.
Did you find an answer or does the issue go away with later versions of Enterprise?
We have the issue with 10.6.1
And the answer, from our local support, to our specific use case:
After reviewing your case and undertaking some research, unfortunately it appears that this functionality is not available using App Login to access Feature Services via ArcGIS Enterprise. In the documentation you have listed below please see the last sub heading 'Available content and services' which lists what you can access using App Login.
Another related bit of documentation is 'Limitations of App Login' found here - https://developers.arcgis.com/documentation/core-concepts/security-and-authentication/limitations-of...
Your use case has been submitted by other Esri customers as an enhancement to be made to the ArcGIS Enterprise product:
ENH-000117119 - 'Provide an ability to use the token generated using client id and client secret of a web application to access a feature service in ArcGIS Enterprise.'
Mind you, we did set the service to public as a test and it still failed. Keeping the service as public was not an option anyways.
I guess that settles it then - I wonder when/if the enhancement will be pushed through...
As I mentioned to another user above, I ended up making the service public, with edit permissions enabled. It's peculiar that it did not work for you still.
I would either need to figure out another method of authenticating, or move my app to my Org's ArcGIS Online platform, where the auth issue is not present.
P.S. It's a small world - I reckon we live in the same state!
Have a look at:
Specifically Non-Interactive Login Experience.
This was changed with the last release of arcpy
Previously was suggested to add username and password to the Interactive example.
PS or Territory
We are thinking of (re)starting a 'usergroup' and if interested drop us an email.