ArcGIS Pro 2.6 API Reference Guide
SignInWithCredentials Method (ArcGISSignOn)

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
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 10, Windows 8.1, Windows 7

See Also

Reference

ArcGISSignOn Class
ArcGISSignOn Members