Skip to content

Commit 3f380c5

Browse files
committed
Change acquire_token_silent(scope, ...) to ...(scopes, ...)
1 parent 967e22c commit 3f380c5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

msal/application.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,18 +198,18 @@ def get_accounts(self):
198198
query={"environment": self.authority.instance})
199199

200200
def acquire_token_silent(
201-
self, scope,
201+
self, scopes,
202202
account=None, # one of the account object returned by get_accounts()
203203
authority=None, # See get_authorization_request_url()
204204
force_refresh=False, # To force refresh an Access Token (not a RT)
205205
**kwargs):
206-
assert isinstance(scope, list), "Invalid parameter type"
206+
assert isinstance(scopes, list), "Invalid parameter type"
207207
the_authority = Authority(authority) if authority else self.authority
208208

209209
if force_refresh == False:
210210
matches = self.token_cache.find(
211211
self.token_cache.CredentialType.ACCESS_TOKEN,
212-
target=scope,
212+
target=scopes,
213213
query={
214214
"client_id": self.client_id,
215215
"environment": the_authority.instance,
@@ -228,7 +228,7 @@ def acquire_token_silent(
228228

229229
matches = self.token_cache.find(
230230
self.token_cache.CredentialType.REFRESH_TOKEN,
231-
# target=scope, # AAD RTs are scope-independent
231+
# target=scopes, # AAD RTs are scope-independent
232232
query={
233233
"client_id": self.client_id,
234234
"environment": the_authority.instance,
@@ -237,12 +237,12 @@ def acquire_token_silent(
237237
})
238238
client = self._build_client(self.client_credential, the_authority)
239239
for entry in matches:
240-
response = client.obtain_token_with_refresh_token(
240+
response = client.obtain_token_by_refresh_token(
241241
entry, rt_getter=lambda token_item: token_item["secret"],
242-
scope=decorate_scope(scope, self.client_id))
242+
scope=decorate_scope(scopes, self.client_id))
243243
if "error" not in response:
244244
return response
245-
logging.debug(
245+
logger.debug(
246246
"Refresh failed. {error}: {error_description}".format(**response))
247247

248248
def initiate_device_flow(self, scopes=None, **kwargs):

0 commit comments

Comments
 (0)