ArcGIS Desktop

  • Documentation
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

GetSigninToken

  • Summary
  • Discussion
  • Syntax
  • Code sample

Summary

Returns token information when signed in to ArcGIS.com or a local portal.

Discussion

The GetSigninToken function will return the token and expiration information when signed in to a portal. This function should be used within a desktop application, either from the Python window or a script tool executed from within the application as it returns the token from the desktop session. If run from a stand-alone script, or the application is not signed in, the function will return None. The token can be used by urllib calls to authenticate with ArcGIS.com services through REST.

Syntax

GetSigninToken ()

Return Value

Data TypeExplanation
Dictionary

A dictionary of key value pairs for token, referer, expires, and messages.

Code sample

GetSigninToken example

Get and print a token within the Python window.

import arcpy

token = arcpy.GetSigninToken()
if token is not None:
    print(token['token'])

Related topics

  • GetActivePortalURL
  • ListPortalURLs

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2019 Esri. | Privacy | Legal