File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -274,20 +274,14 @@ public async Task<IMicrosoftAuthenticationResult> GetTokenForServicePrincipalAsy
274
274
275
275
try
276
276
{
277
- var tokenBuilder = app . AcquireTokenForClient ( scopes ) ;
278
-
279
- if ( sp . SendX5C )
280
- {
281
- tokenBuilder = tokenBuilder . WithSendX5C ( true ) ;
282
- }
283
-
284
- AuthenticationResult result = await tokenBuilder . ExecuteAsync ( ) ;
277
+ Context . Trace . WriteLine ( $ "Sending with X5C: '{ sp . SendX5C } '.") ;
278
+ AuthenticationResult result = await app . AcquireTokenForClient ( scopes ) . WithSendX5C ( sp . SendX5C ) . ExecuteAsync ( ) ; ;
285
279
286
280
return new MsalResult ( result ) ;
287
281
}
288
282
catch ( Exception ex )
289
283
{
290
- Context . Trace . WriteLine ( $ "Failed to acquire token for service principal '{ sp . TenantId } /{ sp . TenantId } '.") ;
284
+ Context . Trace . WriteLine ( $ "Failed to acquire token for service principal '{ sp . TenantId } /{ sp . Id } '.") ;
291
285
Context . Trace . WriteException ( ex ) ;
292
286
throw ;
293
287
}
Original file line number Diff line number Diff line change @@ -555,7 +555,7 @@ private bool UseServicePrincipal(out ServicePrincipalIdentity sp)
555
555
AzureDevOpsConstants . GitConfiguration . Credential . ServicePrincipalCertificateSendX5C ,
556
556
out string certHasX5C ) ;
557
557
558
- sp . SendX5C = ! hasX5CSetting || certHasX5C = = "false" ;
558
+ sp . SendX5C = ! hasX5CSetting || certHasX5C ! = "false" ;
559
559
560
560
X509Certificate2 cert = X509Utils . GetCertificateByThumbprint ( certThumbprint ) ;
561
561
if ( cert is null )
You can’t perform that action at this time.
0 commit comments