ArcGIS Pro 2.9 API Reference Guide
SignInWithCredentials Method (ArcGISPortal)

ArcGIS.Desktop.Core Namespace > ArcGISPortal Class : SignInWithCredentials Method
Synchronous method to Sign on to this portal instance. This method must be called from within a QueuedTask or BackgroundTask.
Syntax
public SignInResult SignInWithCredentials( 
   string username,
   string password
)
Public Function SignInWithCredentials( _
   ByVal username As String, _
   ByVal password As String _
) As SignInResult

Parameters

username
password

Return Value

A SignInResult containing the SignIn status
Exceptions
ExceptionDescription
Thrown when a method is called on the wrong Pro thread
username cannot be null
Remarks
The addin should provide the correct credentials for the given portal. Unlike SignIn, a thread check _is_ enforced when calling this method. SignInWithCredentials should not be called from the UI thread. Use QueuedTask, ArcGIS.Core.Threading.Tasks.BackgroundTask, or a System.Threading.Tasks.Task.
Requirements

Target Platforms: Windows 11, Windows 10, Windows 8.1

See Also

Reference

ArcGISPortal Class
ArcGISPortal Members