@@ -118,7 +118,7 @@ def __repr__(self):
118
118
119
119
class DropboxOAuth2FlowBase (object ):
120
120
121
- def __init__ (self , consumer_key , consumer_secret = None , locale = None , token_access_type = 'legacy' ,
121
+ def __init__ (self , consumer_key , consumer_secret = None , locale = None , token_access_type = None ,
122
122
scope = None , include_granted_scopes = None , use_pkce = False , timeout = DEFAULT_TIMEOUT ):
123
123
if scope is not None and (len (scope ) == 0 or not isinstance (scope , list )):
124
124
raise BadInputException ("Scope list must be of type list" )
@@ -146,7 +146,7 @@ def __init__(self, consumer_key, consumer_secret=None, locale=None, token_access
146
146
self .code_verifier = None
147
147
self .code_challenge = None
148
148
149
- def _get_authorize_url (self , redirect_uri , state , token_access_type , scope = None ,
149
+ def _get_authorize_url (self , redirect_uri , state , token_access_type = None , scope = None ,
150
150
include_granted_scopes = None , code_challenge = None ):
151
151
params = dict (response_type = 'code' ,
152
152
client_id = self .consumer_key )
@@ -156,8 +156,7 @@ def _get_authorize_url(self, redirect_uri, state, token_access_type, scope=None,
156
156
params ['state' ] = state
157
157
if token_access_type is not None :
158
158
assert token_access_type in TOKEN_ACCESS_TYPES
159
- if token_access_type != 'legacy' :
160
- params ['token_access_type' ] = token_access_type
159
+ params ['token_access_type' ] = token_access_type
161
160
if code_challenge :
162
161
params ['code_challenge' ] = code_challenge
163
162
params ['code_challenge_method' ] = 'S256'
@@ -273,7 +272,7 @@ class DropboxOAuth2FlowNoRedirect(DropboxOAuth2FlowBase):
273
272
274
273
"""
275
274
276
- def __init__ (self , consumer_key , consumer_secret = None , locale = None , token_access_type = 'legacy' ,
275
+ def __init__ (self , consumer_key , consumer_secret = None , locale = None , token_access_type = None ,
277
276
scope = None , include_granted_scopes = None , use_pkce = False , timeout = DEFAULT_TIMEOUT ): # noqa: E501;
278
277
"""
279
278
Construct an instance.
@@ -286,6 +285,7 @@ def __init__(self, consumer_key, consumer_secret=None, locale=None, token_access
286
285
:param str token_access_type: the type of token to be requested.
287
286
From the following enum:
288
287
288
+ * None - creates a token with the app default (either legacy or online)
289
289
* legacy - creates one long-lived token with no expiration
290
290
* online - create one short-lived token with an expiration
291
291
* offline - create one short-lived token with an expiration with a refresh token
@@ -359,7 +359,7 @@ class DropboxOAuth2Flow(DropboxOAuth2FlowBase):
359
359
360
360
def __init__ (self , consumer_key , redirect_uri , session ,
361
361
csrf_token_session_key , consumer_secret = None , locale = None ,
362
- token_access_type = 'legacy' , scope = None ,
362
+ token_access_type = None , scope = None ,
363
363
include_granted_scopes = None , use_pkce = False , timeout = DEFAULT_TIMEOUT ):
364
364
"""
365
365
Construct an instance.
@@ -380,6 +380,7 @@ def __init__(self, consumer_key, redirect_uri, session,
380
380
:param str token_access_type: The type of token to be requested.
381
381
From the following enum:
382
382
383
+ * None - creates a token with the app default (either legacy or online)
383
384
* legacy - creates one long-lived token with no expiration
384
385
* online - create one short-lived token with an expiration
385
386
* offline - create one short-lived token with an expiration with a refresh token
0 commit comments