File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 3434from .oauth2cli .oidc import Prompt , IdTokenError
3535from .token_cache import TokenCache , SerializableTokenCache
3636from .auth_scheme import PopAuthScheme
37+
38+ # Putting module-level exceptions into the package namespace, to make them
39+ # 1. officially part of the MSAL public API, and
40+ # 2. can still be caught by the user code even if we change the module structure.
41+ from .oauth2cli .oauth2 import BrowserInteractionTimeoutError
Original file line number Diff line number Diff line change 2828string_types = (str ,) if sys .version_info [0 ] >= 3 else (basestring , )
2929
3030
31+ class BrowserInteractionTimeoutError (RuntimeError ):
32+ pass
33+
3134class BaseClient (object ):
3235 # This low-level interface works. Yet you'll find its sub-class
3336 # more friendly to remind you what parameters are needed in each scenario.
@@ -674,6 +677,8 @@ def _obtain_token_by_browser(
674677 auth_uri_callback = auth_uri_callback ,
675678 browser_name = browser_name ,
676679 )
680+ if auth_response is None :
681+ raise BrowserInteractionTimeoutError ("User did not complete the flow in time" )
677682 return self .obtain_token_by_auth_code_flow (
678683 flow , auth_response , scope = scope , ** kwargs )
679684
You can’t perform that action at this time.
0 commit comments