AngellusMortis / django_microsoft_auth

Simple app to enable Microsoft Account, Office 365 and Xbox Live authentcation as a Django authentcation backend.
MIT License
137 stars 84 forks source link

New Feature: Capture JWT and optionally refresh token from Microsoft and store them #437

Open AngellusMortis opened 3 years ago

AngellusMortis commented 3 years ago

Something I have been wanting to do for a while, but have not gotten the motivation for is exposing access to the user's Microsoft account to the Django application/frontend. To that end, I would like to eventually implement the following:

alfonsrv commented 1 year ago

Requires passing offline_access as scope to acquire a refresh_token from the Microsoft endpoint. Microsoft however removes offline_access scope in the response which in turn raises an exception within oauthlib for scope mismatch (https://github.com/oauthlib/oauthlib/issues/562). This can be suppressed by either setting env variable OAUTHLIB_RELAX_TOKEN_SCOPE or using except Warning.