|
1 | | -from . import oauth2 |
| 1 | +from .oauth2 import Client |
2 | 2 | from .authority import Authority |
3 | 3 | from .request import decorate_scope |
4 | 4 | from .assertion import create_jwt_assertion |
@@ -36,7 +36,7 @@ def acquire_token_silent( |
36 | 36 | **kwargs): |
37 | 37 | the_authority = Authority(authority) if authority else self.authority |
38 | 38 | refresh_token = kwargs.get('refresh_token') # For testing purpose |
39 | | - response = oauth2.Client( |
| 39 | + response = Client( |
40 | 40 | self.client_id, token_endpoint=the_authority.token_endpoint, |
41 | 41 | default_body=self._build_auth_parameters( |
42 | 42 | self.client_credential, |
@@ -98,7 +98,7 @@ def __init__( |
98 | 98 |
|
99 | 99 | def acquire_token_for_client(self, scope, policy=None): |
100 | 100 | token_endpoint = self.authority.token_endpoint |
101 | | - return oauth2.Client( |
| 101 | + return Client( |
102 | 102 | self.client_id, token_endpoint=token_endpoint, |
103 | 103 | default_body=self._build_auth_parameters( |
104 | 104 | self.client_credential, token_endpoint, self.client_id) |
@@ -131,7 +131,7 @@ def get_authorization_request_url( |
131 | 131 | :param str state: Recommended by OAuth2 for CSRF protection. |
132 | 132 | """ |
133 | 133 | the_authority = Authority(authority) if authority else self.authority |
134 | | - client = oauth2.Client( |
| 134 | + client = Client( |
135 | 135 | self.client_id, |
136 | 136 | authorization_endpoint=the_authority.authorization_endpoint) |
137 | 137 | return client.authorization_url( |
@@ -174,7 +174,7 @@ def acquire_token_with_authorization_code( |
174 | 174 | # So in theory, you can omit scope here when you were working with only |
175 | 175 | # one scope. But, MSAL decorates your scope anyway, so they are never |
176 | 176 | # really empty. |
177 | | - return oauth2.Client( |
| 177 | + return Client( |
178 | 178 | self.client_id, token_endpoint=self.authority.token_endpoint, |
179 | 179 | default_body=self._build_auth_parameters( |
180 | 180 | self.client_credential, |
|
0 commit comments