@@ -40,7 +40,7 @@ void init() throws CertificateException, UnrecoverableKeyException, NoSuchAlgori
4040
4141 @ Test
4242 void acquireTokenClientCredentials_ClientCertificate () throws Exception {
43- String clientId = "2afb0add-2f32-4946-ac90-81a02aa4550e" ;
43+ String clientId = TestConstants . MSIDLAB_CLIENT_ID ;
4444 assertAcquireTokenCommon (clientId , certificate , TestConstants .MICROSOFT_AUTHORITY );
4545 }
4646
@@ -49,7 +49,7 @@ void acquireTokenClientCredentials_ClientSecret() throws Exception {
4949 AppCredentialProvider appProvider = new AppCredentialProvider (AzureEnvironment .AZURE );
5050 final String clientId = appProvider .getLabVaultAppId ();
5151 final String password = appProvider .getLabVaultPassword ();
52- IClientCredential credential = ClientCredentialFactory . createFromSecret ( password );
52+ IClientCredential credential = CertificateHelper . getClientCertificate ( );
5353
5454 assertAcquireTokenCommon (clientId , credential , TestConstants .MICROSOFT_AUTHORITY );
5555 }
@@ -90,7 +90,7 @@ void acquireTokenClientCredentials_ClientSecret_Ciam() throws Exception {
9090
9191 @ Test
9292 void acquireTokenClientCredentials_Callback () throws Exception {
93- String clientId = "2afb0add-2f32-4946-ac90-81a02aa4550e" ;
93+ String clientId = TestConstants . MSIDLAB_CLIENT_ID ;
9494
9595 // Creates a valid client assertion using a callback, and uses it to build the client app and make a request
9696 Callable <String > callable = () -> {
@@ -116,11 +116,9 @@ void acquireTokenClientCredentials_Callback() throws Exception {
116116 void acquireTokenClientCredentials_DefaultCacheLookup () throws Exception {
117117 AppCredentialProvider appProvider = new AppCredentialProvider (AzureEnvironment .AZURE );
118118 final String clientId = appProvider .getLabVaultAppId ();
119- final String password = appProvider .getLabVaultPassword ();
120- IClientCredential credential = ClientCredentialFactory .createFromSecret (password );
121119
122120 ConfidentialClientApplication cca = ConfidentialClientApplication .builder (
123- clientId , credential ).
121+ clientId , CertificateHelper . getClientCertificate () ).
124122 authority (TestConstants .MICROSOFT_AUTHORITY ).
125123 build ();
126124
@@ -152,7 +150,7 @@ void acquireTokenClientCredentials_DefaultCacheLookup() throws Exception {
152150
153151 @ Test
154152 void acquireTokenClientCredentials_Regional () throws Exception {
155- String clientId = "2afb0add-2f32-4946-ac90-81a02aa4550e" ;
153+ String clientId = TestConstants . MSIDLAB_CLIENT_ID ;
156154
157155 assertAcquireTokenCommon_withRegion (clientId , certificate , "westus" , TestConstants .REGIONAL_MICROSOFT_AUTHORITY_BASIC_HOST_WESTUS );
158156 }
0 commit comments