Skip to content

Simple Python desktop application to quickly generate an ArcGIS Online token

Notifications You must be signed in to change notification settings

EsriCanada/arcgis-token

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ArcGIS Token Generator

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

Getting Started

A self-contained, pre-built executable for this application is available on the Releases page.

Interested in building your own executable? See below.

Usage

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

How it works

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

Third Party Libraries Used

Build

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

Future Improvements

  • Add the ability to generate a token for ArcGIS for Server

Contributing

Please feel free to fork your own copy and to submit issues

About

Simple Python desktop application to quickly generate an ArcGIS Online token

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages