From 10a8f6f4c5249d336130a8fe8cddcf86ede940d9 Mon Sep 17 00:00:00 2001 From: David Pugh Date: Fri, 18 Dec 2020 17:52:37 +0000 Subject: [PATCH] Fixing docs --- docs/source/advanced.rst | 2 +- src/fastapi_aad_auth/_base/authenticators/session.py | 2 +- src/fastapi_aad_auth/providers/aad.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/advanced.rst b/docs/source/advanced.rst index 4b12bfb..e8e951e 100644 --- a/docs/source/advanced.rst +++ b/docs/source/advanced.rst @@ -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 `_). diff --git a/src/fastapi_aad_auth/_base/authenticators/session.py b/src/fastapi_aad_auth/_base/authenticators/session.py index c47af78..833ac27 100644 --- a/src/fastapi_aad_auth/_base/authenticators/session.py +++ b/src/fastapi_aad_auth/_base/authenticators/session.py @@ -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') diff --git a/src/fastapi_aad_auth/providers/aad.py b/src/fastapi_aad_auth/providers/aad.py index a59469d..653c075 100644 --- a/src/fastapi_aad_auth/providers/aad.py +++ b/src/fastapi_aad_auth/providers/aad.py @@ -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)