@@ -244,7 +244,13 @@ def _get_token_base(
244
244
)
245
245
246
246
def authenticate (
247
- self , * , scopes : Optional [Iterable [str ]] = None , claims : Optional [str ] = None , ** kwargs : Any
247
+ self ,
248
+ * ,
249
+ scopes : Optional [Iterable [str ]] = None ,
250
+ claims : Optional [str ] = None ,
251
+ tenant_id : Optional [str ] = None ,
252
+ enable_cae : bool = False ,
253
+ ** kwargs : Any ,
248
254
) -> AuthenticationRecord :
249
255
"""Interactively authenticate a user. This method will always generate a challenge to the user.
250
256
@@ -253,6 +259,10 @@ def authenticate(
253
259
for these scopes.
254
260
:keyword str claims: additional claims required in the token, such as those provided by
255
261
:func:`AuthenticationRequiredError.claims`
262
+ :keyword str tenant_id: optional tenant to include in the token request.
263
+ :keyword bool enable_cae: indicates whether to enable Continuous Access Evaluation (CAE) for the requested
264
+ token. Access tokens retrieved with CAE enabled will be cached separately from other tokens.
265
+ Defaults to False.
256
266
:return: An AuthenticationRecord containing the authenticated user's information.
257
267
:rtype: ~azure.identity.AuthenticationRecord
258
268
:raises ~azure.core.exceptions.ClientAuthenticationError: authentication failed. The error's ``message``
@@ -268,7 +278,9 @@ def authenticate(
268
278
269
279
scopes = _DEFAULT_AUTHENTICATE_SCOPES [self ._authority ]
270
280
271
- _ = self .get_token (* scopes , _allow_prompt = True , claims = claims , ** kwargs )
281
+ _ = self .get_token (
282
+ * scopes , _allow_prompt = True , claims = claims , tenant_id = tenant_id , enable_cae = enable_cae , ** kwargs
283
+ )
272
284
return self ._auth_record # type: ignore
273
285
274
286
@wrap_exceptions
0 commit comments