Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Dropbox access token without logging in

How to generate Dropbox access token without logging in button.

I have created method to setup oauth2. However it demands to login every time to get a new access token and to refresh oauth2 after every 4 hours. I want to automate this process.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Oauth2 access token can be refreshed using a separate API call, using refresh token. Refresh token is long lived, while access token is short lived.

curl --location 'https://api.dropbox.com/oauth2/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=refresh_token' \
--data-urlencode 'refresh_token=<REFRESH_TOKEN>' \
--data-urlencode 'client_id=<APP_KEY>' \
--data-urlencode 'client_secret=<APP_SECRET>'

You can regenerate access token every time you need it, from within code, rather than using the logins.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading