@@ -1320,20 +1320,20 @@ private async Task<IOrganizationService> InitServiceAsync()
13201320 return null ;
13211321 }
13221322
1323- // Do a WHO AM I request to make sure the connection is good.
1324- if ( ! UseExternalConnection )
1325- {
1326- Guid guIntialTrackingID = Guid . NewGuid ( ) ;
1327- logEntry . Log ( string . Format ( "Beginning Validation of Dataverse Connection. RequestID: {0}" , guIntialTrackingID . ToString ( ) ) ) ;
1328- dtQueryTimer . Restart ( ) ;
1329- user = await GetWhoAmIDetails ( dvService , guIntialTrackingID ) . ConfigureAwait ( false ) ;
1330- dtQueryTimer . Stop ( ) ;
1331- logEntry . Log ( string . Format ( CultureInfo . InvariantCulture , "Validation of Dataverse Connection Complete, total duration: {0}" , dtQueryTimer . Elapsed . ToString ( ) ) ) ;
1332- }
1333- else
1334- {
1335- logEntry . Log ( "External Dataverse Connection Provided, Skipping Validation" ) ;
1336- }
1323+ //// Do a WHO AM I request to make sure the connection is good.
1324+ // if (!UseExternalConnection)
1325+ // {
1326+ // Guid guIntialTrackingID = Guid.NewGuid();
1327+ // logEntry.Log(string.Format("Beginning Validation of Dataverse Connection. RequestID: {0}", guIntialTrackingID.ToString()));
1328+ // dtQueryTimer.Restart();
1329+ // user = await GetWhoAmIDetails(dvService, guIntialTrackingID).ConfigureAwait(false);
1330+ // dtQueryTimer.Stop();
1331+ // logEntry.Log(string.Format(CultureInfo.InvariantCulture, "Validation of Dataverse Connection Complete, total duration: {0}", dtQueryTimer.Elapsed.ToString()));
1332+ // }
1333+ // else
1334+ // {
1335+ // logEntry.Log("External Dataverse Connection Provided, Skipping Validation");
1336+ // }
13371337
13381338 return ( IOrganizationService ) dvService ;
13391339
@@ -1528,11 +1528,11 @@ private async Task RefreshInstanceDetails(IOrganizationService dvService, Uri ur
15281528
15291529 var request = new RetrieveCurrentOrganizationRequest ( ) { AccessType = 0 , RequestId = trackingID } ;
15301530 RetrieveCurrentOrganizationResponse resp ;
1531- logEntry . Log ( string . Format ( CultureInfo . InvariantCulture , "Execute Command - RetrieveCurrentOrganizationRequest : RequestId={0}" , dtQueryTimer . Elapsed . ToString ( ) ) ) ;
1531+ logEntry . Log ( string . Format ( CultureInfo . InvariantCulture , "Execute Command - RetrieveCurrentOrganizationRequest : RequestId={0}" , trackingID ) ) ;
15321532 if ( _configuration . Value . UseWebApiLoginFlow )
15331533 {
15341534 OrganizationResponse orgResp = await Command_WebAPIProcess_ExecuteAsync (
1535- request , null , false , null , Guid . Empty , false , _configuration . Value . MaxRetryCount , _configuration . Value . RetryPauseTime , new CancellationToken ( ) , uriOfInstance ) . ConfigureAwait ( false ) ;
1535+ request , null , false , null , Guid . Empty , false , _configuration . Value . MaxRetryCount , _configuration . Value . RetryPauseTime , new CancellationToken ( ) , uriOfInstance , true ) . ConfigureAwait ( false ) ;
15361536 try
15371537 {
15381538 resp = ( RetrieveCurrentOrganizationResponse ) orgResp ;
@@ -1643,7 +1643,7 @@ internal async Task<WhoAmIResponse> GetWhoAmIDetails(IOrganizationService dvServ
16431643 if ( _configuration . Value . UseWebApiLoginFlow )
16441644 {
16451645 resp = ( WhoAmIResponse ) ( await Command_WebAPIProcess_ExecuteAsync (
1646- req , null , false , null , Guid . Empty , false , _configuration . Value . MaxRetryCount , _configuration . Value . RetryPauseTime , new CancellationToken ( ) ) . ConfigureAwait ( false ) ) ;
1646+ req , null , false , null , Guid . Empty , false , _configuration . Value . MaxRetryCount , _configuration . Value . RetryPauseTime , new CancellationToken ( ) , inLoginFlow : true ) . ConfigureAwait ( false ) ) ;
16471647 }
16481648 else
16491649 {
@@ -1738,11 +1738,11 @@ internal void SetClonedProperties(ServiceClient sourceClient)
17381738 #region WebAPI Interface Utilities
17391739
17401740 internal async Task < OrganizationResponse > Command_WebAPIProcess_ExecuteAsync ( OrganizationRequest req , string logMessageTag , bool bypassPluginExecution ,
1741- MetadataUtility metadataUtlity , Guid callerId , bool disableConnectionLocking , int maxRetryCount , TimeSpan retryPauseTime , CancellationToken cancellationToken , Uri uriOfInstance = null )
1741+ MetadataUtility metadataUtlity , Guid callerId , bool disableConnectionLocking , int maxRetryCount , TimeSpan retryPauseTime , CancellationToken cancellationToken , Uri uriOfInstance = null , bool inLoginFlow = false )
17421742 {
17431743 cancellationToken . ThrowIfCancellationRequested ( ) ;
17441744
1745- if ( ! Utilities . IsRequestValidForTranslationToWebAPI ( req ) ) // THIS WILL GET REMOVED AT SOME POINT, TEMP FOR TRANSTION //TODO:REMOVE ON COMPELTE
1745+ if ( ! Utilities . IsRequestValidForTranslationToWebAPI ( req , inLoginFlow ) ) // THIS WILL GET REMOVED AT SOME POINT, TEMP FOR TRANSTION //TODO:REMOVE ON COMPELTE
17461746 {
17471747 logEntry . Log ( "Execute Organization Request failed, WebAPI is only supported for limited type of messages at this time." , TraceEventType . Error ) ;
17481748 return null ;
@@ -1927,7 +1927,6 @@ internal async Task<OrganizationResponse> Command_WebAPIProcess_ExecuteAsync(Org
19271927 {
19281928 postUri = $ "{ postUri } ?{ addedQueryParams } ";
19291929 }
1930-
19311930 // Execute request
19321931 var sResp = await Command_WebExecuteAsync ( postUri , bodyOfRequest , methodToExecute , headers , "application/json" , logMessageTag , callerId , disableConnectionLocking , maxRetryCount , retryPauseTime , uriOfInstance , cancellationToken : cancellationToken ) . ConfigureAwait ( false ) ;
19331932 if ( sResp != null && sResp . IsSuccessStatusCode )
@@ -1962,7 +1961,6 @@ internal async Task<OrganizationResponse> Command_WebAPIProcess_ExecuteAsync(Org
19621961 else
19631962 {
19641963 var json = await sResp . Content . ReadAsStringAsync ( ) . ConfigureAwait ( false ) ;
1965-
19661964 if ( _knownTypesFactory . TryCreate ( $ "{ req . RequestName } Response", out var response , json ) )
19671965 {
19681966 OrganizationResponse resp = ( OrganizationResponse ) response ;
0 commit comments