...
NB: I am aware that dropbox no longer allow tokens with no expiry (as of September 2021) so I need to go down the refresh token route.
Not exactly! Existing long lived access tokens (if you have any) keep validity. You can't create new such token; all new access tokens are short lived (but only access tokens). It's not the same for refresh tokens; they are without due date!
I don't know what exactly is available in your environment, but if there isn't newer version of the SDK, used by you, and supported SDKs can not be used in your case, you have to manage direct access points call (to receive and manage tokens, at least). You should make sure authorization rules are followed strictly and selected token type is \"offline\". So aside of the regular access token your application will receive refresh token too. When the due date gets close, you can use received refresh token to get a new regular access token in a /oauth2/token call. This should repeat on regular basis whenever need. The rest of the code could work without change with ensured valid access token. That's it.
Hope this helps.
","body@stringLength":"2075","rawBody":"Hi
Seems you are using unsupported SDK. Regular access tokens expire in 4 hours as you noted.
wrote: ...
NB: I am aware that dropbox no longer allow tokens with no expiry (as of September 2021) so I need to go down the refresh token route.
Not exactly! Existing long lived access tokens (if you have any) keep validity. You can't create new such token; all new access tokens are short lived (but only access tokens). It's not the same for refresh tokens; they are without due date!
I don't know what exactly is available in your environment, but if there isn't newer version of the SDK, used by you, and supported SDKs can not be used in your case, you have to manage direct access points call (to receive and manage tokens, at least). You should make sure authorization rules are followed strictly and selected token type is \"offline\". So aside of the regular access token your application will receive refresh token too. When the due date gets close, you can use received refresh token to get a new regular access token in a /oauth2/token call. This should repeat on regular basis whenever need. The rest of the code could work without change with ensured valid access token. That's it.
Hope this helps.
","author":{"__ref":"User:user:422790"},"isEscalated":null,"postTime":"2022-03-08T05:22:19.411-08:00","solution":false,"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"kudosSumWeight":1,"repliesCount":3,"images":{"__typename":"AssociatedImageConnection","edges":[],"totalCount":0,"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"timeToRead":1,"currentRevision":{"__ref":"Revision:revision:582295_1"},"latestVersion":null,"metrics":{"__typename":"MessageMetrics","views":3211},"visibilityScope":"PUBLIC","placeholder":false,"originalMessageForPlaceholder":null,"messagePolicies":{"__typename":"MessagePolicies","canModerateSpamMessage":{"__typename":"PolicyResult","failureReason":{"__typename":"FailureReason","message":"error.lithium.policies.feature.moderation_spam.action.moderate_entity.allowed.accessDenied","key":"error.lithium.policies.feature.moderation_spam.action.moderate_entity.allowed.accessDenied","args":[]}}}},"Revision:revision:582318_1":{"__typename":"Revision","id":"revision:582318_1","lastEditTime":"2022-03-08T07:11:30.908-08:00"},"QueryVariables:ReplyList:message:582318:1":{"__typename":"QueryVariables","id":"ReplyList:message:582318:1","value":{"id":"message:582318","first":10,"sorts":{"postTime":{"direction":"ASC"}},"repliesFirst":3,"repliesFirstDepthThree":1,"repliesSorts":{"postTime":{"direction":"ASC"}},"useAvatar":true,"useAuthorLogin":true,"useAuthorRank":true,"useBody":true,"useKudosCount":true,"useTimeToRead":false,"useMedia":false,"useReadOnlyIcon":false,"useRepliesCount":true,"useSearchSnippet":false,"useAcceptedSolutionButton":true,"useSolvedBadge":false,"useAttachments":false,"attachmentsFirst":5,"useTags":false,"useNodeAncestors":false,"useUserHoverCard":false,"useNodeHoverCard":false,"useModerationStatus":true,"usePreviewSubjectModal":false,"useMessageStatus":true}},"ROOT_MUTATION":{"__typename":"Mutation"},"CachedAsset:text:en_US-shared/client/components/users/UserAvatar-1743510236138":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/users/UserAvatar-1743510236138","value":{"altText":"{login}'s avatar","altTextGeneric":"User's avatar"},"localOverride":false},"CachedAsset:text:en_US-shared/client/components/ranks/UserRankLabel-1743510236138":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/ranks/UserRankLabel-1743510236138","value":{"altTitle":"Icon for {rankName} rank"},"localOverride":false},"CachedAsset:text:en_US-components/messages/AcceptedSolutionButton-1743510236138":{"__typename":"CachedAsset","id":"text:en_US-components/messages/AcceptedSolutionButton-1743510236138","value":{"accept":"Mark as Solution","accepted":"Marked as Solution","errorHeader":"Error!","errorAdd":"There was an error marking as solution.","errorRemove":"There was an error unmarking as solution.","solved":"Solved","topicAlreadySolvedErrorTitle":"Solution Already Exists","topicAlreadySolvedErrorDesc":"Refresh the browser to view the existing solution"},"localOverride":false},"CachedAsset:text:en_US-components/messages/ThreadedReplyList-1743510236138":{"__typename":"CachedAsset","id":"text:en_US-components/messages/ThreadedReplyList-1743510236138","value":{"title":"{count, plural, one{# Reply} other{# Replies}}","title@board:BLOG":"{count, plural, one{# Comment} other{# Comments}}","title@board:TKB":"{count, plural, one{# Comment} other{# Comments}}","title@board:IDEA":"{count, plural, one{# Comment} other{# Comments}}","title@board:OCCASION":"{count, plural, one{# Comment} other{# Comments}}","noRepliesTitle":"No Replies","noRepliesTitle@board:BLOG":"No Comments","noRepliesTitle@board:TKB":"No Comments","noRepliesTitle@board:IDEA":"No Comments","noRepliesTitle@board:OCCASION":"No Comments","noRepliesDescription":"Be the first to reply","noRepliesDescription@board:BLOG":"Be the first to comment","noRepliesDescription@board:TKB":"Be the first to comment","noRepliesDescription@board:IDEA":"Be the first to comment","noRepliesDescription@board:OCCASION":"Be the first to comment","messageReadOnlyAlert:BLOG":"Comments have been turned off for this post","messageReadOnlyAlert:TKB":"Comments have been turned off for this article","messageReadOnlyAlert:IDEA":"Comments have been turned off for this idea","messageReadOnlyAlert:FORUM":"Replies have been turned off for this discussion","messageReadOnlyAlert:OCCASION":"Comments have been turned off for this event"},"localOverride":false},"CachedAsset:text:en_US-shared/client/components/nodes/NodeAvatar-1743510236138":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/nodes/NodeAvatar-1743510236138","value":{"altTitle":"Node avatar for {nodeTitle}"},"localOverride":false},"CachedAsset:text:en_US-shared/client/components/nodes/NodeDescription-1743510236138":{"__typename":"CachedAsset","id":"text:en_US-shared/client/components/nodes/NodeDescription-1743510236138","value":{"description":"{description}"},"localOverride":false},"CachedAsset:text:en_US-components/nodes/NodeTopicsCount-1743510236138":{"__typename":"CachedAsset","id":"text:en_US-components/nodes/NodeTopicsCount-1743510236138","value":{"topicCount":"{count}","topicCountWithNeutralLabel@board:OCCASION":"{count, plural, one{# Event} other{# Events}}","topicCountWithNeutralLabel":"{count, plural, one{# Post} other{# Posts}}","topicCount@board:FORUM":"{count, plural, one{# Post} other{# Posts}}","topicCount@board:BLOG":"{count, plural, one{# Post} other{# Posts}}","topicCount@board:CONTEST":"{count, plural, one{# Entry} other{# Entries}}","topicCount@board:GROUP":"{count, plural, one{# Topic} other{# Topics}}","topicCount@board:IDEA":"{count, plural, one{# Idea} other{# Ideas}}","topicCount@board:QANDA":"{count, plural, one{# Question} other{# Questions}}","topicCount@board:TKB":"{count, plural, one{# Article} other{# Articles}}","topicCount@board:OCCASION":"{count, plural, one{# Event} other{# Events}}","title":"{count, plural,one {Unfortunately, I don't have any info on this regard.
Try edit the SDK used by you. Only the part related to authentication need changes, so shouldn't be a big deal. Just add there refresh token handling and... that's all (I hope the rest works properly). I can't say anything more.
Good luck.
","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"203","kudosSumWeight":0,"postTime":"2022-03-08T07:23:37.512-08:00","lastPublishTime":"2022-03-08T07:23:37.512-08:00","metrics":{"__typename":"MessageMetrics","views":3214},"visibilityScope":"PUBLIC","placeholder":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"entityType":"FORUM_REPLY","eventPath":"category:101000041/category:101007/category:English/community:mxpez29397board:101000014/message:582280/message:582319","replies":{"__typename":"MessageConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[{"__typename":"MessageEdge","cursor":"MjUuMnwyLjF8aXwzfDUyOjF8aW50LDU4MjMyMCw1ODIzMjA","node":{"__ref":"ForumReplyMessage:message:582320"}}]},"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"editFrozen":false,"body@stringLength":"311","rawBody":"Unfortunately, I don't have any info on this regard.
Try edit the SDK used by you. Only the part related to authentication need changes, so shouldn't be a big deal. Just add there refresh token handling and... that's all (I hope the rest works properly). I can't say anything more.
Good luck.
","images":{"__typename":"AssociatedImageConnection","edges":[],"totalCount":0,"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"timeToRead":1,"currentRevision":{"__ref":"Revision:revision:582319_1"},"latestVersion":null,"messagePolicies":{"__typename":"MessagePolicies","canModerateSpamMessage":{"__typename":"PolicyResult","failureReason":{"__typename":"FailureReason","message":"error.lithium.policies.feature.moderation_spam.action.moderate_entity.allowed.accessDenied","key":"error.lithium.policies.feature.moderation_spam.action.moderate_entity.allowed.accessDenied","args":[]}}}},"ModerationData:moderation_data:582320":{"__typename":"ModerationData","id":"moderation_data:582320","status":"APPROVED","rejectReason":null,"isReportedAbuse":false,"rejectUser":null,"rejectTime":null,"rejectActorType":null},"ForumReplyMessage:message:582320":{"__typename":"ForumReplyMessage","author":{"__ref":"User:user:1524479"},"id":"message:582320","revisionNum":1,"uid":582320,"depth":4,"hasGivenKudo":false,"subscribed":false,"board":{"__ref":"Forum:board:101000014"},"parent":{"__ref":"ForumReplyMessage:message:582319"},"conversation":{"__ref":"Conversation:conversation:582280"},"subject":"Re: Getting refresh token for shiny app using rdrop2 and drop_auth()","moderationData":{"__ref":"ModerationData:moderation_data:582320"},"body":"Thank you for the help you have given, it is much appreciated!
","body@stripHtml({\"removeProcessingText\":false,\"removeSpoilerMarkup\":false,\"removeTocMarkup\":false,\"truncateLength\":200})@stringLength":"64","kudosSumWeight":0,"repliesCount":0,"postTime":"2022-03-08T07:27:02.163-08:00","lastPublishTime":"2022-03-08T07:27:02.163-08:00","metrics":{"__typename":"MessageMetrics","views":3173},"visibilityScope":"PUBLIC","placeholder":false,"originalMessageForPlaceholder":null,"isEscalated":null,"solution":false,"entityType":"FORUM_REPLY","eventPath":"category:101000041/category:101007/category:English/community:mxpez29397board:101000014/message:582280/message:582320","replies":{"__typename":"MessageConnection","pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null},"edges":[]},"customFields":[],"attachments":{"__typename":"AttachmentConnection","edges":[],"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"readOnly":false,"editFrozen":false,"body@stringLength":"69","rawBody":"Thank you for the help you have given, it is much appreciated!
","images":{"__typename":"AssociatedImageConnection","edges":[],"totalCount":0,"pageInfo":{"__typename":"PageInfo","hasNextPage":false,"endCursor":null,"hasPreviousPage":false,"startCursor":null}},"timeToRead":1,"currentRevision":{"__ref":"Revision:revision:582320_1"},"latestVersion":null,"messagePolicies":{"__typename":"MessagePolicies","canModerateSpamMessage":{"__typename":"PolicyResult","failureReason":{"__typename":"FailureReason","message":"error.lithium.policies.feature.moderation_spam.action.moderate_entity.allowed.accessDenied","key":"error.lithium.policies.feature.moderation_spam.action.moderate_entity.allowed.accessDenied","args":[]}}}},"CachedAsset:text:en_US-components/tags/TagView/TagViewChip-1743510236138":{"__typename":"CachedAsset","id":"text:en_US-components/tags/TagView/TagViewChip-1743510236138","value":{"tagLabelName":"Tag name {tagName}"},"localOverride":false},"Revision:revision:582320_1":{"__typename":"Revision","id":"revision:582320_1","lastEditTime":"2022-03-08T07:27:02.163-08:00"},"Revision:revision:582319_1":{"__typename":"Revision","id":"revision:582319_1","lastEditTime":"2022-03-08T07:23:37.512-08:00"}}}},"page":"/forums/ForumMessagePage/ForumMessagePage","query":{"boardId":"101000014","messageSubject":"getting-refresh-token-for-shiny-app-using-rdrop2-and-drop-auth","messageId":"582280","replyId":"582318"},"buildId":"Btkyb7T6TeYM9D2gUmiOv","runtimeConfig":{"buildInformationVisible":false,"logLevelApp":"info","logLevelMetrics":"info","openTelemetryClientEnabled":false,"openTelemetryConfigName":"dropbox","openTelemetryServiceVersion":"25.2.0","openTelemetryUniverse":"prod","openTelemetryCollector":"http://localhost:4318","openTelemetryRouteChangeAllowedTime":"5000","apolloDevToolsEnabled":false,"inboxMuteWipFeatureEnabled":false},"isFallback":false,"isExperimentalCompile":false,"dynamicIds":["./components/seo/QAPageSchema/QAPageSchema.tsx","./components/community/Navbar/NavbarWidget.tsx","./components/customComponent/CustomComponent/CustomComponent.tsx","./components/community/Breadcrumb/BreadcrumbWidget.tsx","./components/messages/TopicWithThreadedReplyListWidget/TopicWithThreadedReplyListWidget.tsx","./components/nodes/NodeActionButtonWidget/NodeActionButtonWidget.tsx","./components/nodes/NodeInformationWidget/NodeInformationWidget.tsx","./components/messages/RelatedContentWidget/RelatedContentWidget.tsx","./components/messages/MessageListForNodeByRecentActivityWidget/MessageListForNodeByRecentActivityWidget.tsx","./components/messages/MessageView/MessageViewStandard/MessageViewStandard.tsx","./components/customComponent/CustomComponentContent/HtmlContent.tsx","./components/nodes/NodeView/NodeView.tsx","./components/nodes/NodeView/NodeViewCard/NodeViewCard.tsx","../shared/client/components/common/List/UnstyledList/UnstyledList.tsx","./components/messages/MessageView/MessageView.tsx","./components/messages/MessageView/MessageViewInline/MessageViewInline.tsx","../shared/client/components/common/Pager/PagerLoadMore/PagerLoadMore.tsx","./components/customComponent/CustomComponentContent/TemplateContent.tsx","./components/customComponent/CustomComponentContent/CustomComponentScripts.tsx","../shared/client/components/common/List/UnwrappedList/UnwrappedList.tsx","./components/tags/TagView/TagView.tsx","./components/tags/TagView/TagViewChip/TagViewChip.tsx"],"appGip":true,"scriptLoader":[]}