-
Notifications
You must be signed in to change notification settings - Fork 208
Description
Describe the bug
I noticed that when you don't set up a timeout for the request and you close the browser without doing the login. The thread that gets created for the request doesn't terminate, which cause the application to hang indefinitely.
To Reproduce
Steps to reproduce the behavior:
- interactive_sample.py
- pretty much just follow the workflow there.
Expected behavior
I've used the msal library in other languages and the expected behavior is usually a thrown exception when the browser is closed.
What you see instead
a hanging thread that runs indefinitely. In the screenshot, I've paused the thread to see the stack trace.
The MSAL Python version you are using
1.32.0
Additional context
In the file authcode.py AuthCodeReceiver._get_auth_response method. the method self._server.handler_request() is being called and is basically waiting a request, which I assume is waiting a response for the login browser. When the browser gets closed before the login, no message is sent to the _server, which basically is in a infinite loop waiting for a request (it doesn't have timeout). if you are using a terminal you need to ctrl+c to stop the running script and if you are using a gui like Tkinter or something, you basically need to force quit the application.
