@@ -692,14 +692,16 @@ def _test_acquire_token_obo(self, config_pca, config_cca,
692
692
result = cca .acquire_token_silent (config_cca ["scope" ], account )
693
693
self .assertEqual (cca_result ["access_token" ], result ["access_token" ])
694
694
695
- def _test_acquire_token_by_client_secret (
696
- self , client_id = None , client_secret = None , authority = None , scope = None ,
695
+ def _test_acquire_token_for_client (
696
+ self , client_id = None , client_credential = None , authority = None , scope = None ,
697
697
oidc_authority = None ,
698
698
** ignored ):
699
- assert client_id and client_secret and scope and (
699
+ assert client_id and client_credential and scope and (
700
700
authority or oidc_authority )
701
701
self .app = msal .ConfidentialClientApplication (
702
- client_id , client_credential = client_secret , authority = authority ,
702
+ client_id ,
703
+ client_credential = client_credential ,
704
+ authority = authority ,
703
705
oidc_authority = oidc_authority ,
704
706
http_client = MinimalHttpClient ())
705
707
result = self .app .acquire_token_for_client (scope )
@@ -936,9 +938,9 @@ def test_acquire_token_by_client_secret(self):
936
938
# Vastly different than ArlingtonCloudTestCase.test_acquire_token_by_client_secret()
937
939
_app = self .get_lab_app_object (
938
940
publicClient = "no" , signinAudience = "AzureAdMyOrg" )
939
- self ._test_acquire_token_by_client_secret (
941
+ self ._test_acquire_token_for_client (
940
942
client_id = _app ["appId" ],
941
- client_secret = self .get_lab_user_secret (
943
+ client_credential = self .get_lab_user_secret (
942
944
_app ["clientSecret" ].split ("/" )[- 1 ]),
943
945
authority = "{}{}.onmicrosoft.com" .format (
944
946
_app ["authority" ], _app ["labName" ].lower ().rstrip (".com" )),
@@ -1047,9 +1049,9 @@ def test_ciam_acquire_token_for_client(self):
1047
1049
else : # Ciam6 era has a URL path that ends with the secret name
1048
1050
secret_name = secret_url .path .split ("/" )[- 1 ]
1049
1051
logger .info ('Detected secret name "%s" from "%s"' , secret_name , raw_url )
1050
- self ._test_acquire_token_by_client_secret (
1052
+ self ._test_acquire_token_for_client (
1051
1053
client_id = self .app_config ["appId" ],
1052
- client_secret = self .get_lab_user_secret (secret_name ),
1054
+ client_credential = self .get_lab_user_secret (secret_name ),
1053
1055
authority = self .app_config .get ("authority" ),
1054
1056
oidc_authority = self .app_config .get ("oidc_authority" ),
1055
1057
scope = self .app_config ["scopes" ], # It shall ends with "/.default"
@@ -1212,8 +1214,8 @@ def test_acquire_token_by_ropc(self):
1212
1214
1213
1215
def test_acquire_token_by_client_secret (self ):
1214
1216
config = self .get_lab_user (usertype = "cloud" , azureenvironment = self .environment , publicClient = "no" )
1215
- config ["client_secret " ] = self .get_lab_user_secret ("ARLMSIDLAB1-IDLASBS-App-CC-Secret" )
1216
- self ._test_acquire_token_by_client_secret (** config )
1217
+ config ["client_credential " ] = self .get_lab_user_secret ("ARLMSIDLAB1-IDLASBS-App-CC-Secret" )
1218
+ self ._test_acquire_token_for_client (** config )
1217
1219
1218
1220
def test_acquire_token_obo (self ):
1219
1221
config_cca = self .get_lab_user (
0 commit comments