ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.SystemCore Namespace / ArcGISSignOn Class / SignInWithCredentials Method
The uri of the portal to sign on to
The user name to use for credentails or null
The password to use for credentials or null
The referer to use with the access token
The returned access token

In This Topic
    SignInWithCredentials Method (ArcGISSignOn)
    In This Topic
    Sign in to the portal provided by the Uri. This method is for use in CoreHost applications only
    Syntax
    public bool SignInWithCredentials( 
       Uri portalUri,
       string user,
       string password,
       out string referer,
       out string token
    )
    Public Function SignInWithCredentials( _
       ByVal portalUri As Uri, _
       ByVal user As String, _
       ByVal password As String, _
       ByRef referer As String, _
       ByRef token As String _
    ) As Boolean

    Parameters

    portalUri
    The uri of the portal to sign on to
    user
    The user name to use for credentails or null
    password
    The password to use for credentials or null
    referer
    The referer to use with the access token
    token
    The returned access token
    Exceptions
    ExceptionDescription
    This method is for use in CoreHost applications only
    Invalid portal uri
    General system core exception; for example if a conversion combination is not supported.
    Remarks
    For use in CoreHost applications only. A SystemCoreException will be thrown if signon fails.
    CoreHost clients should not call this method in their code directly. Instead they should implement an ISignOnHandler that will be called back whenever a credential is required for a connection to a portal or online (e.g. a connection is being attempted to a federated feature service).
    Use SetSignonHandler to set your sign on handler. Within the ISignOnHandler.GenerateCredentials callback, CoreHost clients should call SignInWithCredentials to sign on passing in the portal URI provided to you via the GenerateCredentials SIGNONHANDLERINFO.agoURL parameter. The token and referer are returned for convenience but there is really no need to use them in your code unless you want to make your own REST calls to the federated portal(s) directly. Underlying feature services will automatically aquire the generated access token without you needing to do anything further.
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also