AzureAD / microsoft-authentication-library-for-python

Microsoft Authentication Library (MSAL) for Python makes it easy to authenticate to Microsoft Entra ID. General docs are available here https://learn.microsoft.com/entra/msal/python/ Stable APIs are documented here https://msal-python.readthedocs.io. Questions can be asked on www.stackoverflow.com with tag "msal" + "python".
https://stackoverflow.com/questions/tagged/azure-ad-msal+python
Other
770 stars 192 forks source link

Make `http_client`'s `max_retries` configurable #432

Closed jiasli closed 2 years ago

jiasli commented 2 years ago

Symptom

The one-time retry introduced by https://github.com/AzureAD/microsoft-authentication-library-for-python/pull/326 seems to be insufficient:

https://github.com/AzureAD/microsoft-authentication-library-for-python/blob/62752adbcc8700c9e5969cacdce64c23bb8802c8/msal/application.py#L423-L425

Transient ConnectionError can still makes MSAL fail: https://github.com/AzureAD/microsoft-authentication-library-for-python/issues/431

Alternatives

Of course I can provide my HTTP client, but this seems too heavy for such as small parameter tweak.

rayluo commented 2 years ago

This issue was created when #431 was observed. Now we have addressed #431 in its corresponding PR, by providing clearer error message. End user will then make educated decision on manual retry when needed. So, there is less need for an app to automatically choose a max retries value.

Besides, max_retries is an http layer behavior. It does not really belong to the MSAL or OAuth2 layer. We choose to not make this change.