Skip to content

Commit 97dc978

Browse files
authored
Remove unnecessary base class (#12374)
1 parent a5a1db1 commit 97dc978

File tree

2 files changed

+8
-18
lines changed

2 files changed

+8
-18
lines changed

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def get_default_authority():
3737
from .certificate_credential_base import CertificateCredentialBase
3838
from .client_secret_credential_base import ClientSecretCredentialBase
3939
from .exception_wrapper import wrap_exceptions
40-
from .msal_credentials import InteractiveCredential, PublicClientCredential
40+
from .msal_credentials import InteractiveCredential
4141

4242

4343
def _scopes_to_resource(*scopes):
@@ -64,6 +64,5 @@ def _scopes_to_resource(*scopes):
6464
"get_default_authority",
6565
"InteractiveCredential",
6666
"normalize_authority",
67-
"PublicClientCredential",
6867
"wrap_exceptions",
6968
]

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

+7-16
Original file line numberDiff line numberDiff line change
@@ -127,22 +127,7 @@ def _create_app(self, cls):
127127
return app
128128

129129

130-
class PublicClientCredential(MsalCredential):
131-
"""Wraps an MSAL PublicClientApplication with the TokenCredential API"""
132-
133-
@abc.abstractmethod
134-
def get_token(self, *scopes, **kwargs): # pylint:disable=unused-argument
135-
# type: (*str, **Any) -> AccessToken
136-
pass
137-
138-
def _get_app(self):
139-
# type: () -> msal.PublicClientApplication
140-
if not self._msal_app:
141-
self._msal_app = self._create_app(msal.PublicClientApplication)
142-
return self._msal_app
143-
144-
145-
class InteractiveCredential(PublicClientCredential):
130+
class InteractiveCredential(MsalCredential):
146131
def __init__(self, **kwargs):
147132
self._disable_automatic_authentication = kwargs.pop("disable_automatic_authentication", False)
148133
self._auth_record = kwargs.pop("authentication_record", None) # type: Optional[AuthenticationRecord]
@@ -246,3 +231,9 @@ def _acquire_token_silent(self, *scopes, **kwargs):
246231
def _request_token(self, *scopes, **kwargs):
247232
# type: (*str, **Any) -> dict
248233
"""Request an access token via a non-silent MSAL token acquisition method, returning that method's result"""
234+
235+
def _get_app(self):
236+
# type: () -> msal.PublicClientApplication
237+
if not self._msal_app:
238+
self._msal_app = self._create_app(msal.PublicClientApplication)
239+
return self._msal_app

0 commit comments

Comments
 (0)