You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## About Dropbox long-lived tokens (and offline mode access)
7
-
Dropbox didn't provide anymore (since On September 30th, 2021) long-live access token from dropbox portal ([src](https://dropbox.tech/developers/migrating-app-permissions-and-access-tokens#retiring-legacy-tokens)).
7
+
HowTo get Dropbox refresh-token and/or access-token (console interactive mode)
8
8
9
-
In order to access offline to dropbox services without having to login, you will need:
9
+
````bash
10
+
npm i -g dropbox-refresh-token@latest
11
+
get_refresh_token
12
+
# follow instructions
13
+
````
14
+
NB: `get_refresh_token` binary has some alias : `drt` and `dropbox_get_refresh_token`.
15
+
16
+
NB2: if you have cloned this project you could instead invoke this with `./bin/get_refresh_token.js`
17
+
18
+
## Context : about Dropbox tokens
19
+
20
+
Short context about Dropbox long-lived tokens (and offline mode access).
21
+
22
+
Dropbox didn't provide anymore (since On September 30th, 2021) long-live access token from dropbox portal ([src](https://dropbox.tech/developers/migrating-app-permissions-and-access-tokens#retiring-legacy-tokens)). This was the way to use token for offline applications.
23
+
24
+
Now, in order to access offline to dropbox services without having to login,
25
+
you will need an offline **refresh-token**.
26
+
And with this token you application is able to request a short-lived access token to call Dropbox API.
27
+
28
+
Here are the steps:
10
29
1) to ask an **access-code for an "offline" token-access-type**
11
30
- this step require to login to allow application access.
12
31
2) get a (long-lived) **refresh-token** with this access-code.
@@ -29,29 +48,40 @@ Having this **refresh-token** in "offline" mode (without login requirement) you
29
48
30
49
## Project features
31
50
Feature for a given DropBox app (appKey, appSecret).
32
-
- (step 1) build login url to allow application access and then retrieve short-lived access code for an "offline" token-access-type (appKey only)
51
+
- (step 1) build login url to allow application access and then retrieve short-lived access code for an "offline" token-access-type (appKey only)
52
+
`getShortLivedAccessCodeUrlViaLoginUrl(appKey)`
33
53
- (step 2) provide method to call Dropbox API that ask (long-lived) refresh-token from this short-lived access code (accessCode, appKey, appSecret).
- (step 3++) provide method to call Dropbox API that ask a fresh (short-lived) access token from a valid refresh-token (refreshToke, appKey, appSecret).
##Console mode step-by-step to retrieve Dropbox RefreshToken
78
+
### Another example - step-by-step to retrieve Dropbox RefreshToken
52
79
53
80
<!> original idea is [FranklinThaker/Dropbox-API-Uninterrupted-Access](https://github.com/FranklinThaker/Dropbox-API-Uninterrupted-Access) which provide (webApplication mode)
54
81
82
+
This workflow rely on environment variables and require project install
0 commit comments