ArcGIS Pro 2.9 API Reference Guide
GetToken Method

ArcGIS.Desktop.Core Namespace > ArcGISPortal Class : 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.
Syntax
public string GetToken()
Public Function GetToken() As String

Return Value

a System.string that is the current token
Remarks
Known issue: A thread check is not enforced.
Requirements

Target Platforms: Windows 11, Windows 10, Windows 8.1

See Also

Reference

ArcGISPortal Class
ArcGISPortal Members
SignInResult Class