@@ -238,7 +238,7 @@ def acquire_token_by_authorization_code(
238
238
# REQUIRED, if the "redirect_uri" parameter was included in the
239
239
# authorization request as described in Section 4.1.1, and their
240
240
# values MUST be identical.
241
- ):
241
+ ** kwargs ):
242
242
"""The second half of the Authorization Code Grant.
243
243
244
244
:param code: The authorization code returned from Authorization Server.
@@ -270,9 +270,11 @@ def acquire_token_by_authorization_code(
270
270
# really empty.
271
271
assert isinstance (scopes , list ), "Invalid parameter type"
272
272
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 )
276
278
277
279
def get_accounts (self , username = None ):
278
280
"""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):
551
553
"""
552
554
return self .client .obtain_token_by_device_flow (
553
555
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:
555
558
# during transition period,
556
559
# service seemingly need both device_code and code parameter.
557
560
** kwargs )
0 commit comments