@@ -289,7 +289,7 @@ public async Task<bool> PopulateTokenTargetId(TargetUri targetUri, Token authori
289
289
}
290
290
}
291
291
292
- Trace . WriteLine ( $ "failed to acquire the token's target identity for `{ targetUri } ` [{ ( int ) response . StatusCode } ].") ;
292
+ Trace . WriteLine ( $ "failed to acquire the token's target identity for `{ requestUri ? . QueryUri } ` [{ ( int ) response . StatusCode } ].") ;
293
293
}
294
294
}
295
295
catch ( HttpRequestException exception )
@@ -372,13 +372,13 @@ internal async Task<TargetUri> GetIdentityServiceUri(TargetUri targetUri, Secret
372
372
}
373
373
}
374
374
375
- Trace . WriteLine ( $ "failed to find Identity Service for '{ targetUri } ' via location service [{ ( int ) response . StatusCode } ].") ;
375
+ Trace . WriteLine ( $ "failed to find Identity Service for '{ requestUri ? . QueryUri } ' via location service [{ ( int ) response . StatusCode } ].") ;
376
376
}
377
377
}
378
378
catch ( Exception exception )
379
379
{
380
380
Trace . WriteException ( exception ) ;
381
- throw new LocationServiceException ( $ "Helper for `{ targetUri } `.", exception ) ;
381
+ throw new LocationServiceException ( $ "Helper for `{ requestUri ? . QueryUri } `.", exception ) ;
382
382
}
383
383
384
384
return null ;
@@ -454,7 +454,7 @@ internal async Task<bool> ValidateSecret(TargetUri targetUri, Secret secret)
454
454
// If the server responds with content, and said content matches the anonymous details the credentials are invalid.
455
455
if ( content != null && Regex . IsMatch ( content , AnonymousUserPattern , RegexOptions . CultureInvariant | RegexOptions . IgnoreCase ) )
456
456
{
457
- Trace . WriteLine ( $ "credential validation for '{ targetUri } ' failed.") ;
457
+ Trace . WriteLine ( $ "credential validation for '{ requestUri ? . QueryUri } ' failed.") ;
458
458
459
459
return false ;
460
460
}
@@ -463,7 +463,7 @@ internal async Task<bool> ValidateSecret(TargetUri targetUri, Secret secret)
463
463
if ( statusCode >= HttpStatusCode . OK && statusCode < HttpStatusCode . Ambiguous )
464
464
return true ;
465
465
466
- Trace . WriteLine ( $ "credential validation for '{ targetUri } ' failed [{ ( int ) response . StatusCode } ].") ;
466
+ Trace . WriteLine ( $ "credential validation for '{ requestUri ? . QueryUri } ' failed [{ ( int ) response . StatusCode } ].") ;
467
467
468
468
// Even if the service responded, if the issue isn't a 400 class response then the credentials were likely not rejected.
469
469
if ( statusCode < HttpStatusCode . BadRequest || statusCode >= HttpStatusCode . InternalServerError )
@@ -474,20 +474,20 @@ internal async Task<bool> ValidateSecret(TargetUri targetUri, Secret secret)
474
474
{
475
475
// Since we're unable to invalidate the credentials, return optimistic results.
476
476
// This avoid credential invalidation due to network instability, etc.
477
- Trace . WriteLine ( $ "unable to validate credentials for '{ targetUri } ', failure occurred before server could respond.") ;
477
+ Trace . WriteLine ( $ "unable to validate credentials for '{ requestUri ? . QueryUri } ', failure occurred before server could respond.") ;
478
478
Trace . WriteException ( exception ) ;
479
479
480
480
return true ;
481
481
}
482
482
catch ( Exception exception )
483
483
{
484
- Trace . WriteLine ( $ "credential validation for '{ targetUri } ' failed.") ;
484
+ Trace . WriteLine ( $ "credential validation for '{ requestUri ? . QueryUri } ' failed.") ;
485
485
Trace . WriteException ( exception ) ;
486
486
487
487
return false ;
488
488
}
489
489
490
- Trace . WriteLine ( $ "credential validation for '{ targetUri } ' failed.") ;
490
+ Trace . WriteLine ( $ "credential validation for '{ requestUri ? . QueryUri } ' failed.") ;
491
491
return false ;
492
492
}
493
493
@@ -530,7 +530,7 @@ private StringContent GetAccessTokenRequestBody(TargetUri targetUri, TokenScope
530
530
531
531
string tokenUrl = GetTargetUrl ( targetUri , false ) ;
532
532
533
- Trace . WriteLine ( $ "creating access token scoped to '{ tokenScope } ' for '{ targetUri } '") ;
533
+ Trace . WriteLine ( $ "creating access token scoped to '{ tokenScope } ' for '{ tokenUrl } '") ;
534
534
535
535
string jsonContent = ( duration . HasValue && duration . Value > TimeSpan . FromHours ( 1 ) )
536
536
? string . Format ( Culture . InvariantCulture , ContentTimedJsonFormat , tokenScope , tokenUrl , Settings . MachineName , DateTime . UtcNow + duration . Value )
0 commit comments