@@ -242,18 +242,24 @@ def _main():
242242 enable_broker = _input_boolean ("Enable broker? It will error out later if your app has not registered some redirect URI" )
243243 enable_debug_log = _input_boolean ("Enable MSAL Python's DEBUG log?" )
244244 enable_pii_log = _input_boolean ("Enable PII in broker's log?" ) if enable_broker and enable_debug_log else False
245+ authority = _select_options ([
246+ "https://login.microsoftonline.com/common" ,
247+ "https://login.microsoftonline.com/organizations" ,
248+ "https://login.microsoftonline.com/microsoft.onmicrosoft.com" ,
249+ "https://login.microsoftonline.com/msidlab4.onmicrosoft.com" ,
250+ "https://login.microsoftonline.com/consumers" ,
251+ ],
252+ header = "Input authority (Note that MSA-PT apps would NOT use the /common authority)" ,
253+ accept_nonempty_string = True ,
254+ )
255+ instance_discovery = _input_boolean (
256+ "You input an unusual authority which might fail the Instance Discovery. "
257+ "Now, do you want to perform Instance Discovery on your input authority?"
258+ ) if not authority .startswith ("https://login.microsoftonline.com" ) else None
245259 app = msal .PublicClientApplication (
246260 chosen_app ["client_id" ] if isinstance (chosen_app , dict ) else chosen_app ,
247- authority = _select_options ([
248- "https://login.microsoftonline.com/common" ,
249- "https://login.microsoftonline.com/organizations" ,
250- "https://login.microsoftonline.com/microsoft.onmicrosoft.com" ,
251- "https://login.microsoftonline.com/msidlab4.onmicrosoft.com" ,
252- "https://login.microsoftonline.com/consumers" ,
253- ],
254- header = "Input authority (Note that MSA-PT apps would NOT use the /common authority)" ,
255- accept_nonempty_string = True ,
256- ),
261+ authority = authority ,
262+ instance_discovery = instance_discovery ,
257263 enable_broker_on_windows = enable_broker ,
258264 enable_pii_log = enable_pii_log ,
259265 token_cache = global_cache ,
0 commit comments