cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We are making some updates so the Community might be down for a few hours on Monday the 11th of November. Apologies for the inconvenience and thank you for your patience. You can find out more here.

Discuss Dropbox Developer & API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dropbox OAuth2 Endpoint not giving refresh Token

Dropbox OAuth2 Endpoint not giving refresh Token

w3Abhishek
Explorer | Level 4

Hey Dropbox Team,

 

I am using the Dropbox OAuth2 API for my personal project. But after receiving the authorization code from the user through OAuth URL.

 

w3Abhishek_0-1709991435225.png


I used it to get the access_token and refresh_token but upon sending the authorization code, the API is only sending access_token which get expired and not refresh token.

Now, how I will be able to refresh the access_token after expiration? 

Help me.

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff

@w3Abhishek Здравко is correct; you'll need to set token_access_type=offline on the authorization URL in order to receive a refresh token from /oauth2/token. Refer to the following resources for more information:

View solution in original post

3 Replies 3

Здравко
Legendary | Level 20

Hi @w3Abhishek,

If nothing set explicit as token access type, it's as assumed to be online access type! You need offline access type for refresh token. If you have forgotten set this parameter, just set it on OAuth2 initiation. 😉 Take a look here for possible flow. Note the parameter token_access_type.

Hope this helps.

Greg-DB
Dropbox Staff

@w3Abhishek Здравко is correct; you'll need to set token_access_type=offline on the authorization URL in order to receive a refresh token from /oauth2/token. Refer to the following resources for more information:

w3Abhishek
Explorer | Level 4

Thanks Greg-DB and Здравко. Adding token_access_type=offline in my OAuth URL solved the problem.

 

 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    w3Abhishek Explorer | Level 4
  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Здравко Legendary | Level 20
What do Dropbox user levels mean?