Skip to content

Commit f823577

Browse files
committed
Remove auth_provider_options as a constructor to AuthorizationHandler
1 parent 31036b5 commit f823577

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

msgraphcore/graph_session.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,12 @@ class GraphSession(Session):
1414
"""
1515
Extends session object with graph functionality
1616
"""
17-
def __init__(self, scopes: [str], auth_provider: AuthProviderBase, middleware: list = []):
17+
def __init__(self, auth_provider: AuthProviderBase, middleware: list = []):
1818
super().__init__()
1919
self.headers.update({'sdkVersion': 'graph-python-' + SDK_VERSION})
2020
self._base_url = BASE_URL
2121

22-
options = AuthMiddlewareOptions(scopes)
23-
auth_handler = AuthorizationHandler(auth_provider, auth_provider_options=options)
22+
auth_handler = AuthorizationHandler(auth_provider)
2423

2524
middleware.insert(0, auth_handler)
2625
self._register(middleware)

msgraphcore/middleware/authorization_handler.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44

55

66
class AuthorizationHandler(BaseMiddleware):
7-
def __init__(self, auth_provider: AuthProviderBase, auth_provider_options=None):
7+
def __init__(self, auth_provider: AuthProviderBase):
88
super().__init__()
99
self.auth_provider = auth_provider
10-
self.auth_provider_options = auth_provider_options
1110
self.retry_count = 0
1211

1312
def send(self, request, **kwargs):

msgraphcore/middleware/authorization_provider.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33

44
class TokenCredentialAuthProvider(AuthProviderBase):
5-
def __init__(self, credential: TokenCredential):
5+
def __init__(self, scopes: str, credential: TokenCredential):
66
self.credential = credential
7-
self.scopes = ''
7+
self.scopes = scopes
88

99
def get_access_token(self):
1010
return self.credential.get_token(self.scopes)[0]

0 commit comments

Comments
 (0)