3737 "Select the account you want to log in with. "
3838 "For more information on login with Azure CLI, see https://go.microsoft.com/fwlink/?linkid=2271136" )
3939
40- PASSWORD_CERTIFICATE_WARNING = (
41- "Passing the service principal certificate with `--password` is deprecated and will be removed "
42- "by version 2.74. Please use `--certificate` instead." )
43-
4440logger = get_logger (__name__ )
4541
4642
@@ -307,7 +303,7 @@ def build_from_credential(cls, tenant_id, client_id, credential):
307303 return ServicePrincipalAuth (entry )
308304
309305 @classmethod
310- def build_credential (cls , secret_or_certificate = None ,
306+ def build_credential (cls , client_secret = None ,
311307 certificate = None , use_cert_sn_issuer = None ,
312308 client_assertion = None ):
313309 """Build credential from user input. The credential looks like below, but only one key can exist.
@@ -318,20 +314,12 @@ def build_credential(cls, secret_or_certificate=None,
318314 }
319315 """
320316 entry = {}
321- if certificate :
317+ if client_secret :
318+ entry [_CLIENT_SECRET ] = client_secret
319+ elif certificate :
322320 entry [_CERTIFICATE ] = os .path .expanduser (certificate )
323321 if use_cert_sn_issuer :
324322 entry [_USE_CERT_SN_ISSUER ] = use_cert_sn_issuer
325- elif secret_or_certificate :
326- # TODO: Make secret_or_certificate secret only
327- user_expanded = os .path .expanduser (secret_or_certificate )
328- if os .path .isfile (user_expanded ):
329- logger .warning (PASSWORD_CERTIFICATE_WARNING )
330- entry [_CERTIFICATE ] = user_expanded
331- if use_cert_sn_issuer :
332- entry [_USE_CERT_SN_ISSUER ] = use_cert_sn_issuer
333- else :
334- entry [_CLIENT_SECRET ] = secret_or_certificate
335323 elif client_assertion :
336324 entry [_CLIENT_ASSERTION ] = client_assertion
337325 return entry
0 commit comments