Skip to content

Commit 63497ae

Browse files
authored
Remove authentication_record property (Azure#11760)
1 parent 5a40b24 commit 63497ae

File tree

4 files changed

+13
-22
lines changed

4 files changed

+13
-22
lines changed

sdk/identity/azure-identity/azure/identity/_internal/msal_credentials.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -252,13 +252,7 @@ def authenticate(self, **kwargs):
252252
scopes = _DEFAULT_AUTHENTICATE_SCOPES[self._authority]
253253

254254
_ = self.get_token(*scopes, _allow_prompt=True, **kwargs)
255-
return self.authentication_record # type: ignore
256-
257-
@property
258-
def authentication_record(self):
259-
# type: () -> Optional[AuthenticationRecord]
260-
""":class:`~azure.identity.AuthenticationRecord` for the most recent authentication"""
261-
return self._auth_record
255+
return self._auth_record # type: ignore
262256

263257
@wrap_exceptions
264258
def _acquire_token_silent(self, *scopes, **kwargs):

sdk/identity/azure-identity/tests/test_browser_credential.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,10 @@ def test_authenticate():
8383
)
8484
record = credential.authenticate(scopes=(scope,))
8585

86-
for auth_record in (record, credential.authentication_record):
87-
assert auth_record.authority == environment
88-
assert auth_record.home_account_id == object_id + "." + home_tenant
89-
assert auth_record.tenant_id == home_tenant
90-
assert auth_record.username == username
86+
assert record.authority == environment
87+
assert record.home_account_id == object_id + "." + home_tenant
88+
assert record.tenant_id == home_tenant
89+
assert record.username == username
9190

9291
# credential should have a cached access token for the scope used in authenticate
9392
with patch(WEBBROWSER_OPEN, Mock(side_effect=Exception("credential should authenticate silently"))):

sdk/identity/azure-identity/tests/test_device_code_credential.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,10 @@ def test_authenticate():
7878
_cache=TokenCache(),
7979
)
8080
record = credential.authenticate(scopes=(scope,))
81-
for auth_record in (record, credential.authentication_record):
82-
assert auth_record.authority == environment
83-
assert auth_record.home_account_id == object_id + "." + home_tenant
84-
assert auth_record.tenant_id == home_tenant
85-
assert auth_record.username == username
81+
assert record.authority == environment
82+
assert record.home_account_id == object_id + "." + home_tenant
83+
assert record.tenant_id == home_tenant
84+
assert record.username == username
8685

8786
# credential should have a cached access token for the scope used in authenticate
8887
token = credential.get_token(scope)

sdk/identity/azure-identity/tests/test_username_password_credential.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,10 @@ def test_authenticate():
126126
transport=transport,
127127
)
128128
record = credential.authenticate(scopes=(scope,))
129-
for auth_record in (record, credential.authentication_record):
130-
assert auth_record.authority == environment
131-
assert auth_record.home_account_id == object_id + "." + home_tenant
132-
assert auth_record.tenant_id == home_tenant
133-
assert auth_record.username == username
129+
assert record.authority == environment
130+
assert record.home_account_id == object_id + "." + home_tenant
131+
assert record.tenant_id == home_tenant
132+
assert record.username == username
134133

135134
# credential should have a cached access token for the scope passed to authenticate
136135
token = credential.get_token(scope)

0 commit comments

Comments
 (0)