Forum Discussion

Omri1984's avatar
Omri1984
Explorer | Level 4
3 years ago

When using the .net sdk with out user interaction, do i need to implement the refresh token method

When using the .net sdk without user interaction, do i need to implement the refresh token method?

or the sdk will refresh it automatically.

 

i know it depend on the request in the auth "offline" or 

 

i want that the sdk will handle the refresh token.

 

what happened if i use the token and then not using it for a while and then use it again, will it refresh automatically?

what is the best way to support this scenario ?

 

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    If your app needs long-term access without repeated manual user interaction, the app should request offline access to get a refresh token. Refresh tokens don't expire by default (though they can be revoked on demand) so they can be stored and re-used multiple times over long periods of time without the user present.

     

    The .NET SDK will handle the refresh process for you automatically as long as you provide the necessary credentials (i.e., refresh token, etc.) as shown in the examples. You can find an example of getting and using a refresh token in the OauthBasic example (non-PKCE, meant for server-side apps) as well as in the OAuthPKCE example (PKCE, meant for client-side apps).