@@ -238,7 +238,7 @@ def acquire_token_by_authorization_code(
238238 # REQUIRED, if the "redirect_uri" parameter was included in the
239239 # authorization request as described in Section 4.1.1, and their
240240 # values MUST be identical.
241- ):
241+ ** kwargs ):
242242 """The second half of the Authorization Code Grant.
243243
244244 :param code: The authorization code returned from Authorization Server.
@@ -270,9 +270,11 @@ def acquire_token_by_authorization_code(
270270 # really empty.
271271 assert isinstance (scopes , list ), "Invalid parameter type"
272272 return self .client .obtain_token_by_authorization_code (
273- code , redirect_uri = redirect_uri ,
274- data = {"scope" : decorate_scope (scopes , self .client_id )},
275- )
273+ code , redirect_uri = redirect_uri ,
274+ data = dict (
275+ kwargs .pop ("data" , {}),
276+ scope = decorate_scope (scopes , self .client_id )),
277+ ** kwargs )
276278
277279 def get_accounts (self , username = None ):
278280 """Get a list of accounts which previously signed in, i.e. exists in cache.
@@ -551,7 +553,8 @@ def acquire_token_by_device_flow(self, flow, **kwargs):
551553 """
552554 return self .client .obtain_token_by_device_flow (
553555 flow ,
554- data = {"code" : flow ["device_code" ]}, # 2018-10-4 Hack:
556+ data = dict (kwargs .pop ("data" , {}), code = flow ["device_code" ]),
557+ # 2018-10-4 Hack:
555558 # during transition period,
556559 # service seemingly need both device_code and code parameter.
557560 ** kwargs )
0 commit comments