@@ -543,31 +543,24 @@ private static bool AreEqual(byte[] a1, byte[] a2)
543
543
544
544
private IPublicClientApplication CreateClientAppInstance ( PublicClientAppKey publicClientAppKey )
545
545
{
546
- IPublicClientApplication publicClientApplication ;
547
-
548
- #if NETFRAMEWORK
549
- if ( _iWin32WindowFunc != null )
550
- {
551
- publicClientApplication = PublicClientApplicationBuilder . Create ( publicClientAppKey . _applicationClientId )
552
- . WithAuthority ( publicClientAppKey . _authority )
553
- . WithClientName ( DbConnectionStringDefaults . ApplicationName )
554
- . WithClientVersion ( Common . ADP . GetAssemblyVersion ( ) . ToString ( ) )
555
- . WithRedirectUri ( publicClientAppKey . _redirectUri )
556
- . WithParentActivityOrWindow ( _iWin32WindowFunc )
557
- . Build ( ) ;
558
- }
559
- else
560
- #endif
546
+ PublicClientApplicationBuilder builder = PublicClientApplicationBuilder
547
+ . CreateWithApplicationOptions ( new PublicClientApplicationOptions
548
+ {
549
+ ClientId = publicClientAppKey . _applicationClientId ,
550
+ ClientName = DbConnectionStringDefaults . ApplicationName ,
551
+ ClientVersion = Common . ADP . GetAssemblyVersion ( ) . ToString ( ) ,
552
+ RedirectUri = publicClientAppKey . _redirectUri ,
553
+ } )
554
+ . WithAuthority ( publicClientAppKey . _authority ) ;
555
+
556
+ #if NETFRAMEWORK
557
+ if ( _iWin32WindowFunc is not null )
561
558
{
562
- publicClientApplication = PublicClientApplicationBuilder . Create ( publicClientAppKey . _applicationClientId )
563
- . WithAuthority ( publicClientAppKey . _authority )
564
- . WithClientName ( DbConnectionStringDefaults . ApplicationName )
565
- . WithClientVersion ( Common . ADP . GetAssemblyVersion ( ) . ToString ( ) )
566
- . WithRedirectUri ( publicClientAppKey . _redirectUri )
567
- . Build ( ) ;
559
+ builder . WithParentActivityOrWindow ( _iWin32WindowFunc ) ;
568
560
}
561
+ #endif
569
562
570
- return publicClientApplication ;
563
+ return builder . Build ( ) ;
571
564
}
572
565
573
566
private static TokenCredentialData CreateTokenCredentialInstance ( TokenCredentialKey tokenCredentialKey , string secret )
0 commit comments