@@ -68,7 +68,8 @@ public record PublicClientConfig
6868public partial class EntraAuthentication
6969{
7070 private const string MacBrokerRedirectUrl = "msauth.com.msauth.unsignedapp://auth" ;
71- private readonly PublicClientConfig _publicClientConfig ;
71+
72+ public PublicClientConfig PublicClientConfig { get ; }
7273
7374 public async Task < InteractionMode > GetInteractionModeAsync ( CancellationToken ct = default )
7475 {
@@ -219,7 +220,7 @@ private async Task<AuthenticationResult> GetTokenForUserSilentAsync(
219220 try
220221 {
221222 return await app . AcquireTokenSilent ( scopes , msalAccount )
222- . WithMsaPassthroughTransfer ( _publicClientConfig . IsMsaPassthroughEnabled , msalAccount )
223+ . WithMsaPassthroughTransfer ( PublicClientConfig . IsMsaPassthroughEnabled , msalAccount )
223224 . ExecuteAsync ( ct ) ;
224225 }
225226 catch ( MsalUiRequiredException )
@@ -439,7 +440,7 @@ private Task ShowDeviceCodeAsync(DeviceCodeResult dcr)
439440 /// <param name="useBroker">True if the broker will be used for this applications build using this builder.</param>
440441 private PublicClientApplicationBuilder GetPublicAppBuilder ( out bool useBroker )
441442 {
442- if ( _publicClientConfig is null )
443+ if ( PublicClientConfig is null )
443444 {
444445 throw new InvalidOperationException (
445446 "Public client configuration is required for user authentication." ) ;
@@ -448,7 +449,7 @@ private PublicClientApplicationBuilder GetPublicAppBuilder(out bool useBroker)
448449 if ( _publicBuilder is null )
449450 {
450451 Context . Trace . WriteLine ( "Creating public client application builder..." ) ;
451- var builder = PublicClientApplicationBuilder . Create ( _publicClientConfig . ClientId )
452+ var builder = PublicClientApplicationBuilder . Create ( PublicClientConfig . ClientId )
452453 . WithHttpClientFactory ( _httpFactory )
453454 . WithTraceLogging ( Context )
454455 . WithLegacyCacheCompatibility ( false )
@@ -459,9 +460,9 @@ private PublicClientApplicationBuilder GetPublicAppBuilder(out bool useBroker)
459460 if ( Context . SessionManager . IsDesktopSession && IsBrokerEnabled ( ) )
460461 {
461462 // Check that the app config supports the broker on this platform
462- if ( _publicClientConfig . SupportsWindowsBroker && PlatformUtils . IsWindows ( ) ||
463- _publicClientConfig . SupportsMacBroker && PlatformUtils . IsMacOS ( ) ||
464- _publicClientConfig . SupportsLinuxBroker && PlatformUtils . IsLinux ( ) )
463+ if ( PublicClientConfig . SupportsWindowsBroker && PlatformUtils . IsWindows ( ) ||
464+ PublicClientConfig . SupportsMacBroker && PlatformUtils . IsMacOS ( ) ||
465+ PublicClientConfig . SupportsLinuxBroker && PlatformUtils . IsLinux ( ) )
465466 {
466467 Context . Trace . WriteLine ( "Broker is supported by the app and enabled by the user." ) ;
467468
@@ -514,20 +515,20 @@ private BrokerOptions GetBrokerOptions()
514515 {
515516 var oses = BrokerOptions . OperatingSystems . None ;
516517
517- if ( _publicClientConfig . SupportsWindowsBroker )
518+ if ( PublicClientConfig . SupportsWindowsBroker )
518519 oses |= BrokerOptions . OperatingSystems . Windows ;
519520
520- if ( _publicClientConfig . SupportsMacBroker )
521+ if ( PublicClientConfig . SupportsMacBroker )
521522 oses |= BrokerOptions . OperatingSystems . OSX ;
522523
523- if ( _publicClientConfig . SupportsLinuxBroker )
524+ if ( PublicClientConfig . SupportsLinuxBroker )
524525 oses |= BrokerOptions . OperatingSystems . Linux ;
525526
526527 return new BrokerOptions ( oses )
527528 {
528529 Title = "Git Credential Manager" ,
529530 ListOperatingSystemAccounts = true ,
530- MsaPassthrough = _publicClientConfig . IsMsaPassthroughEnabled
531+ MsaPassthrough = PublicClientConfig . IsMsaPassthroughEnabled
531532 } ;
532533 }
533534
0 commit comments