microsoft-authentication-library-for-python icon indicating copy to clipboard operation
microsoft-authentication-library-for-python copied to clipboard

PROPOSAL: support for python requests auth

Open snowman2 opened this issue 3 years ago • 2 comments

https://github.com/corteva/msal-requests-auth

Any interest to support something like this (i.e. absorbing msal-requests-auth into msal-python)?

snowman2 avatar Apr 07 '21 20:04 snowman2

Thanks, @snowman2 , for taking the initiative to create your repo. Because of the unambiguity of source code, this becomes the most clear proposal of all time. :-)

We may not take your project as-is, but we will take inspirations from your project.

  1. Your project currently wraps MSAL's Device Code Flow. Based on your implementation, your intended scenario is running the Device Code Flow on your current device. In that case, a newer API acquire_token_interactive() from recent MSAL versions would be more convenient.
  2. Since we introduced the customizable http_client behavior one year ago, MSAL could potentially be used with other http stack. So, it would be difficult to introduce yet another set of requests-only API into MSAL.
  3. Your project still raises a valid point, that you basically wrap our boilerplate sample on cache-handling into one API call. We will see what we can do here. Marking this one as an enhancement, for now.

rayluo avatar Apr 07 '21 21:04 rayluo

Since we introduced the customizable http_client behavior one year ago, MSAL could potentially be used with other http stack. So, it would be difficult to introduce yet another set of requests-only API into MSAL.

I think having requests be the main supported client library wouldn't be a bad direction to go in since it is already a dependency. Also, the amount of code that you add when bringing it in is quite small. With that in mind, I bet you could make a case for it if you were interested. But, I am also biased in the hoping that it will be taken in. :smile:

However, if you prefer to head in the direction to reduce the amount of code necessary in msal-requests-auth, I am fine with that too.

snowman2 avatar Apr 08 '21 12:04 snowman2