@@ -279,20 +279,20 @@ class PublicClientApplication(ClientApplication): # browser app or mobile app
279279 # super(PublicClientApplication, self).__init__(client_id, **kwargs)
280280 # self.redirect_uri = redirect_uri or self.OUT_OF_BAND
281281
282- def acquire_token_with_username_password (
283- self , username , password , scope = None , ** kwargs ):
282+ def acquire_token_by_username_password (
283+ self , username , password , scopes = None , ** kwargs ):
284284 """Gets a token for a given resource via user credentails."""
285- scope = decorate_scope (scope , self .client_id )
285+ scopes = decorate_scope (scopes , self .client_id )
286286 if not self .authority .is_adfs :
287287 user_realm_result = self .authority .user_realm_discovery (username )
288288 if user_realm_result .get ("account_type" ) == "Federated" :
289- return self ._acquire_token_with_username_password_federated (
290- user_realm_result , username , password , scope = scope , ** kwargs )
291- return self .client .obtain_token_with_username_password (
292- username , password , scope = scope , ** kwargs )
289+ return self ._acquire_token_by_username_password_federated (
290+ user_realm_result , username , password , scopes = scopes , ** kwargs )
291+ return self .client .obtain_token_by_username_password (
292+ username , password , scope = scopes , ** kwargs )
293293
294- def _acquire_token_with_username_password_federated (
295- self , user_realm_result , username , password , scope = None , ** kwargs ):
294+ def _acquire_token_by_username_password_federated (
295+ self , user_realm_result , username , password , scopes = None , ** kwargs ):
296296 wstrust_endpoint = {}
297297 if user_realm_result .get ("federation_metadata_url" ):
298298 wstrust_endpoint = mex .send_request (
@@ -313,9 +313,9 @@ def _acquire_token_with_username_password_federated(
313313 if not grant_type :
314314 raise RuntimeError (
315315 "RSTR returned unknown token type: %s" , wstrust_result .get ("type" ))
316- return self .client .obtain_token_with_assertion (
316+ return self .client .obtain_token_by_assertion (
317317 b64encode (wstrust_result ["token" ]),
318- grant_type = grant_type , scope = scope , ** kwargs )
318+ grant_type = grant_type , scope = scopes , ** kwargs )
319319
320320 def acquire_token (
321321 self ,
0 commit comments