-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Access token expiration #86
Comments
A workmate helped me: instead of using an access token we manually got a refresh token (it should never expire) and used it. .env:
config\app.php:
config\filesystems.php:
app\Adapters\AutoRefreshingDropBoxTokenService.php:
app\Providers\DropboxServiceProvider.php:
Use example:
|
@anderea1 The refresh_token is the same one you generated in DROPBOX_ACCESS_TOKEN here https://www.dropbox.com/developers/apps |
I get a 'Refresh token is malformed' error when using the token generated in the dropbox app console, as the refresh token {"error": "invalid_grant", "error_description": "refresh token is malformed"} Still unsure how to get the refresh token described above. |
I'm also getting the 'token is malformed' error |
I just generated a refresh token using this guide: |
Dear contributor, because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it. |
app\Providers\DropboxServiceProvider.php:
|
I tried something else personally, without using AutoRefreshingDropBoxTokenService [ not necessary when using the You will still need to authorize the access to the Dropbox App using this link :
This will give you the
Giving you access to the .env.example
config/filesystems.php
`app/Providers/DropboxServiceProvider.php
A PR in code and documentation should be interesting. Should I PR this ? The previous code is also indicated in the Laravel 10 Documentation - Custom Filesystems |
@itemshopp Exactly what I needed, thanks so much for sharing. |
Main solution: https://gist.github.com/phuze/755dd1f58fba6849fbf7478e77e2896a In short key point are:
|
Hi,
I am using spatie/flysystem-dropbox (^1.2) and I get dropbox directories with:
$dirs = Storage::disk('dropbox')->directories();
or files with:
$files = Storage::disk('dropbox')->files($foldername);
I wrote these 2 variable in .env file:
DROPBOX_ACCESS_TOKEN=sl.BLOC_r...
DROPBOX_APP_SECRET=...
I got DROPBOX_ACCESS_TOKEN here https://www.dropbox.com/developers/apps
After 4 hours I get this error:
Client error:
POST https://api.dropboxapi.com/2/files/list_folder
resulted in a401 Unauthorized
response:{"error_summary": "expired_access_token/.", "error": {".tag": "expired_access_token"}}
{"exception":"[object] (GuzzleHttp\Exception\ClientException(code: 401): Client error:
POST https://api.dropboxapi.com/2/files/list_folder
resulted in a401 Unauthorized
response:{"error_summary": "expired_access_token/.", "error": {".tag": "expired_access_token"}}
at /home/xxx/laravel/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113)
I manually solve it going back to https://www.dropbox.com/developers/apps, generating a new token and writing it in .env.
How can I avoid this manual step?
The text was updated successfully, but these errors were encountered: