Select to view content in your preferred language

Places 401 req auth no token, even though I have apikey

108
3
Saturday
mnoel2
by
New Contributor II

Hi 

I have a simple application that finds the nearest UFO sightings when the user enters a city and clicks search. A popup will display the UFO sighting and show details and how far from the city entered.

I have created the credentials in the new Arcgis platform for developers, I have created an apiKey and assigned the proper privileges to my local application and hosted service in AGOL: 

and referenced in the code. My ApiKey is set to expire at the end of the month. However, I'm still getting unable to authorize access without token. I thought based on the esri documentation my application only needs the apikey to access the services such as places.

You can view code at https://github.com/mnavidad/UFOSIGHTINGSAPP/  use vite to run code

Tags (3)
0 Kudos
3 Replies
JamesIng
New Contributor III

There seems to be a bit of confusion, but from what I have tested and understand.

The newly released API keys in Esri Location Platform (formerly esri platform) only works with featureServices that have been uploaded into the same account - Not AGOL. Accessing features in AGOL still requires the standardised Esri authentication.

James from www.landkind.com
0 Kudos
mnoel2
by
New Contributor II

Hi James

thank you for your response, pardon I do not follow, my feature service has been loaded or it is hosted in the account I had to create that is an AGOL account that is tied to the Arcgis platform for developers.  

0 Kudos
JamesIng
New Contributor III

@mnoel2- I believe this is the case where there's a bit of confusion.

So to use a API key - you must create a separate esri location platform account and host your featureService from there. This is different from a developer account associated with an AGOL account.

Only then I believe the API key will work for accessing the content, otherwise you'll need to follow standard esri authentication guidelines around using oAuth

James from www.landkind.com
0 Kudos