Simple Python desktop application to quickly generate an ArcGIS Online token. Users will mainly use this utility when developing applications and require an AGOL token for testing purposes. About ArcGIS Tokens
A self-contained, pre-built executable for this application is available on the Releases page.
Interested in building your own executable? See below.
Once an executable is downloaded/built and run, a small dialog will appear containing the extent of the application.
- Supply your username and password for your ArcGIS Online Organizational Account
- Choose an expiration duration
- Choose whether the token will be automatically copied to your computer's clipboard
- Submit the request using the Get Token button
- Messages will appear showing success status and if granted, a timestamp of expiration
- Now that you have a token, you can make a request to secured Esri services
- Example for testing here
Remember that any credits consumed by the requests you make here will be deducted from your ArcGIS Online account. See the Credit Overview for more information and to use a Credit Estimator
The working code of the application is quite simple and uses the ArcGIS REST API Generate Token operation to request a token
Example:
https://www.arcgis.com/sharing/rest/generateToken
username=jsmith33
password=myPassword
expiration=60
referer=http://www.arcgis.com
- PyQt4
- Direct Download for Windows 32 bit installer, Python 2.7
- Pyinstaller
- Python for Windows (pywin32) as a dependency for Pyinstaller
- Direct Download for pywin32, Python 2.7
Building an executable from this script can be done using py2exe or pyinstaller. The instructions below use pyinstaller to build an self-contained executable named ArcGIS-Token.exe
Download the source code and make sure you have the appropriate dependencies (PyQt4 and pyinstaller)
See the pyinstaller manual for documentation and options.
pip install pyinstaller
pyinstaller --name=ArcGIS-Token --onefile --windowed --noconsole --icon=images/icon-windowed.ico arcgis_token.py
The executable should be created in the /dist folder
- Add the ability to generate a token for ArcGIS for Server
Please feel free to fork your own copy and to submit issues