Skip to content

Commit

Permalink
Fixing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
djpugh committed Dec 18, 2020
1 parent ab89787 commit 10a8f6f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/source/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ Token Scopes

This means that scopes are requested against the ``client_id`` of the application rather than e.g. MS Graph or similar, if your backend API needs to
access Microsoft (or other APIs) you will need to use e.g. an additional msal instance (or provide specific additional ``scopes`` through the
:py:method:`fastapi_aad_auth._base.authenticators.session.get_access_token`, with ``app_scopes=False``), if those permissions are added on the App Registration.
:py:meth:`fastapi_aad_auth.providers.aad.AADSessionAuthenticator.get_access_token`, with ``app_scopes=False``), if those permissions are added on the App Registration.

Alternatively, you can use an on-behalf-of flow (see `Azure Docs <https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-on-behalf-of-flow>`_).
2 changes: 1 addition & 1 deletion src/fastapi_aad_auth/_base/authenticators/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def process_login_callback(self, request):
def _process_code(self, request, auth_state, code):
raise NotImplementedError('Implement in subclass')

def get_access_token(self, user, scopes=None):
def get_access_token(self, user, scopes=None, app_scopes=True):
"""Get the access token for the user."""
raise NotImplementedError('Implement in subclass')

Expand Down
4 changes: 2 additions & 2 deletions src/fastapi_aad_auth/providers/aad.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ def _get_authorization_url(self, request, session_state):
prompt=self._prompt,
domain_hint=self._domain_hint)

def get_access_token(self, user, scopes=None, _app_scopes=True):
def get_access_token(self, user, scopes=None, app_scopes=True):
"""Get the access token for the user."""
result = None
account = None
if scopes is None:
scopes = self._scopes
elif _app_scopes:
elif app_scopes:
scopes = self.as_app_scopes(scopes)
if user.username:
account = self.msal_application.get_accounts(user.username)
Expand Down

0 comments on commit 10a8f6f

Please sign in to comment.