File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -274,20 +274,14 @@ public async Task<IMicrosoftAuthenticationResult> GetTokenForServicePrincipalAsy
274274
275275 try
276276 {
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 ( ) ; ;
285279
286280 return new MsalResult ( result ) ;
287281 }
288282 catch ( Exception ex )
289283 {
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 } '.") ;
291285 Context . Trace . WriteException ( ex ) ;
292286 throw ;
293287 }
Original file line number Diff line number Diff line change @@ -555,7 +555,7 @@ private bool UseServicePrincipal(out ServicePrincipalIdentity sp)
555555 AzureDevOpsConstants . GitConfiguration . Credential . ServicePrincipalCertificateSendX5C ,
556556 out string certHasX5C ) ;
557557
558- sp . SendX5C = ! hasX5CSetting || certHasX5C = = "false" ;
558+ sp . SendX5C = ! hasX5CSetting || certHasX5C ! = "false" ;
559559
560560 X509Certificate2 cert = X509Utils . GetCertificateByThumbprint ( certThumbprint ) ;
561561 if ( cert is null )
You can’t perform that action at this time.
0 commit comments