Select to view content in your preferred language

querying feature layer with API & oauth token - getting 403 for some but not others

57
2
yesterday
jakubk
by
New Contributor II

I'm trying to automate pulling data from AGOL into our databricks environment

I've registered an application and have the token generation working

I'm using the https://services3.arcgis.com/xyz/ArcGIS/rest/services/abc/FeatureServer/0/query? api endpoint

It works for feature layers I own/created but I get a 403 for all other feature layers even though I can 'manually' browse to the api endpoint from the features' overview page

What do i need to do to configure it in agol so it can access all the org data?

0 Kudos
2 Replies
simoxu
by MVP Regular Contributor
MVP Regular Contributor

Not sure what type of development environment you are using...
Maybe try different authentication method, such as user authentication. It seems you are using App authentication which has some limitations.

Please see if the following doc helps

https://developers.arcgis.com/documentation/security-and-authentication/introduction/

 

0 Kudos
jakubk
by
New Contributor II

Thanks @simoxu

My environment is azure databricks notebooks atm but will eventually migrate to data factory so i'm limited to rest api calls

I did eventually see that the oauth app implementation in agol is very different and much more limited compared to the standard api auth for other webapps so it definitely wont work in my use case

Do you have any examples of how i could leverage the 'user auth' approach when all i'm doing is automated REST calls? I can't prompt a user to sign in manually as it will be being run as a background/system task. I also tried putting in the temp token from the user auth oauth2.0 app i created but that gave me 403s for every feature layer query, even the ones that worked using app auth!

 

 

0 Kudos