ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Core Namespace / ArcGISPortal Class / GetToken Method
Version

GetToken Method
Gets the current token for the session. The ArcGISPortal class automatically manages the token expiration. This value should not be cached. This method should be called from within a QueuedTask or System.Threading.Task unless the caller is within ArcGIS.Desktop.Framework.Contracts.ConfigurationManager.OnApplicationInitializing in which case the main thread should be used.
Syntax
public string GetToken()

Return Value

a System.string that is the current token
Exceptions
ExceptionDescription
Thrown when a method is called on the wrong Pro thread
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3 or higher.
See Also