HOW TO
cURL is a free and open-source computer software project providing a library and command-line tool for transferring data using various network protocols. The name stands for "Client for URL".
OAuth 2.0 is an authorization protocol and NOT an authentication protocol. In this article we look at a workflow to generate ArcGIS Online OAuth 2.0 token using cURL with the help of a registered application within ArcGIS Online using its client_id and its client_secret. You can use OAuth 2.0 to authenticate ArcGIS users to access content and location services on behalf of the authenticated user.
Example:
curl -X POST -d client_id=ZbJ1dzdXc2cYHYPF -d client_secret=e9bce20fce0b4a078b54877bfab03533 -d grant_type=client_credentials https://www.arcgis.com/sharing/oauth2/token
Note:
Replace the client_id and the client_secret with the information from your registered 'Other application'.
Example:
curl -X POST -H 'Accept-Encoding:gzip,deflate' -d client_id=ZbJ1dzdXc2cYHYPF -d client_secret=e9bce20fce0b4a078b54877bfab03533 -d grant_type=client_credentials https://www.arcgis.com/sharing/oauth2/token -v -i
Article ID: 000034096
Get help from ArcGIS experts
Download the Esri Support App