API Key For Arcgis Online Feature Layers

435
5
Jump to solution
12-08-2023 12:31 AM
aydemiremrah
New Contributor II

hello, i am new to Arcgis Developer. i have a web application. users upload a geographic file from the interface. my nodejs server converts this file to geojson. My goal is to add this geojson file to the feature layer in my Arcgis Online account. I am creating an api key from my Arcgis Developer account. But I don't see an option for this api key to access the layers in my Arcgis Online account. I give all authorisations from Scope, but I still get a 403 error.

aydemiremrah_0-1702024219289.png

 

0 Kudos
1 Solution

Accepted Solutions
JakeSkinner
Esri Esteemed Contributor

Hi @aydemiremrah,

You have limited functionality with the token generated from the developers page.  You will want to generate a token using the generateToken method using a username/password.

View solution in original post

5 Replies
JakeSkinner
Esri Esteemed Contributor

Hi @aydemiremrah,

You have limited functionality with the token generated from the developers page.  You will want to generate a token using the generateToken method using a username/password.

aydemiremrah
New Contributor II

@JakeSkinner Hello, thank you for the answer. Is there any way to create a permanent api key? I want to assign an api key with no time limit on my server. Token keys last a maximum of 15 days.

0 Kudos
JakeSkinner
Esri Esteemed Contributor

Unfortunately, not.  15 days is the max.

0 Kudos
aydemiremrah
New Contributor II

@JakeSkinner Thank you. If you were doing a similar project, what method would you prefer? Would you use something like a middleware that checks whether the token has expired and automatically renews it if it has expired? Obviously, I don't want to store a username and password directly in my project.

0 Kudos
JakeSkinner
Esri Esteemed Contributor

@aydemiremrah I don't have much experience with JavaScript, but if I were doing this in python, I would store the username/password in a secure config file that the script would call.  The script would retrieve the username/password and generate the token.

0 Kudos