Created
August 23, 2017 02:48
-
-
Save TheBryanMac/5b1ce71944bfff66fa3f88a1b8929a1c to your computer and use it in GitHub Desktop.
Python script to generate a token from ArcGIS Server for use with secure map services
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Name: Generate a token from ArcGIS Server using python | |
#Author: Bryan McIntosh | |
#Description: Python script to generate a token from ArcGIS Server for use with secure map services. | |
# This sample uses the 'requests' module (https://pypi.python.org/pypi/requests/2.7.0) | |
import requests | |
params = {'username': 'USERNAME', 'password': 'PASSWORD', 'client': 'requestip', 'f': 'json'} | |
request = requests.post('https://YOUR.SITE.com/arcgis/tokens',params=params) | |
response = request.json() | |
myToken = response["token"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment