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 34
34
from .oauth2cli .oidc import Prompt , IdTokenError
35
35
from .token_cache import TokenCache , SerializableTokenCache
36
36
from .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 28
28
string_types = (str ,) if sys .version_info [0 ] >= 3 else (basestring , )
29
29
30
30
31
+ class BrowserInteractionTimeoutError (RuntimeError ):
32
+ pass
33
+
31
34
class BaseClient (object ):
32
35
# This low-level interface works. Yet you'll find its sub-class
33
36
# more friendly to remind you what parameters are needed in each scenario.
@@ -674,6 +677,8 @@ def _obtain_token_by_browser(
674
677
auth_uri_callback = auth_uri_callback ,
675
678
browser_name = browser_name ,
676
679
)
680
+ if auth_response is None :
681
+ raise BrowserInteractionTimeoutError ("User did not complete the flow in time" )
677
682
return self .obtain_token_by_auth_code_flow (
678
683
flow , auth_response , scope = scope , ** kwargs )
679
684
You can’t perform that action at this time.
0 commit comments