yonghah / esri2sf

Scrape features from ArcGIS Server REST API and create simple features dataframe
Other
138 stars 37 forks source link

generateToken does not work for hosted arcgis online #7

Closed behrica closed 6 years ago

behrica commented 6 years ago

The authentication with Arcgis ONnine has an other way to get a token, by using a clientId and clientSecret and uses a fixed server name

Explained here: https://developers.arcgis.com/documentation/core-concepts/security-and-authentication/accessing-arcgis-online-services/

The following curl works for me and returns a working token:

 curl -X POST   
  -d "f=json"    
 -d "client_id=xxxxx"   
  -d "client_secret=yyyyy"    
 -d "grant_type=client_credentials"    
 -d "expiration=1440" 
https://www.arcgis.com/sharing/rest/oauth2/token/

I think we should have support for this here.