@@ -194,6 +194,21 @@ def obtain_token_by_username_password(self, username, password, **kwargs):
194
194
username , password , headers = headers , ** kwargs )
195
195
196
196
197
+ def _msal_extension_check ():
198
+ # Can't run this in module or class level otherwise you'll get circular import error
199
+ try :
200
+ from msal_extensions import __version__ as v
201
+ major , minor , _ = v .split ("." , maxsplit = 3 )
202
+ if not (int (major ) >= 1 and int (minor ) >= 2 ):
203
+ warnings .warn (
204
+ "Please upgrade msal-extensions. "
205
+ "Only msal-extensions 1.2+ can work with msal 1.30+" )
206
+ except ImportError :
207
+ pass # The optional msal_extensions is not installed. Business as usual.
208
+ except ValueError :
209
+ logger .exception (f"msal_extensions version { v } not in major.minor.patch format" )
210
+
211
+
197
212
class ClientApplication (object ):
198
213
"""You do not usually directly use this class. Use its subclasses instead:
199
214
:class:`PublicClientApplication` and :class:`ConfidentialClientApplication`.
@@ -635,6 +650,8 @@ def __init__(
635
650
self .authority_groups = None
636
651
self ._telemetry_buffer = {}
637
652
self ._telemetry_lock = Lock ()
653
+ _msal_extension_check ()
654
+
638
655
639
656
def _decide_broker (self , allow_broker , enable_pii_log ):
640
657
is_confidential_app = self .client_credential or isinstance (
0 commit comments