Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OAuth2Client: defer initial token fetch when user interaction is requ…
…ired (#8354) Currently the initial token fetch occurs when `start()` is called. This is fine for grant types that do not need user input and speeds up the process so that tokens are hopefully available when the client is actually used the first time. But there are 2 issues with this "early start": * If user input is required, then a background thread will block waiting for the user; this thread cannot be interrupted. * In case the fetch fails, confusing log messages are printed in the console (confusing because they happen before the user tries to use the client). This PR thus defers the initial token fetch in case of user interaction until the user actually attempts to use the client. It also defers printing any log messages until the client has been accessed for the first time.
- Loading branch information