<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Java SDK issues with short lived token in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-issues-with-short-lived-token/m-p/520113#M25379</link>
    <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1648"&gt;@vewert&lt;/a&gt; No, just using the startOAuth2PKCE method will not change the "Access token expiration" setting in the App Console for any of your apps.&lt;/P&gt;</description>
    <pubDate>Thu, 13 May 2021 13:34:53 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2021-05-13T13:34:53Z</dc:date>
    <item>
      <title>Java SDK issues with short lived token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-issues-with-short-lived-token/m-p/508280#M25098</link>
      <description>&lt;P&gt;Hi there, I need some help to migrate to the short lived token.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Normally I check if I have the token, then call or execute the other doprobx APIs (e.g. file upload):&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;Auth.startOAuth2Authentication(getActivity(), db_k);&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While now I call:&lt;/P&gt;
&lt;PRE&gt;Auth.&lt;SPAN&gt;startOAuth2PKCE&lt;/SPAN&gt;(&lt;SPAN&gt;context&lt;/SPAN&gt;, &lt;SPAN&gt;db_k&lt;/SPAN&gt;, DbxRequestConfig.&lt;SPAN&gt;newBuilder&lt;/SPAN&gt;(&lt;SPAN&gt;"app"&lt;/SPAN&gt;)&lt;BR /&gt;        .withHttpRequestor(&lt;SPAN&gt;new &lt;/SPAN&gt;OkHttp3Requestor(OkHttp3Requestor.&lt;SPAN&gt;defaultOkHttpClient&lt;/SPAN&gt;()))&lt;BR /&gt;        .build(), Collections.&lt;SPAN&gt;singleton&lt;/SPAN&gt;(&lt;SPAN&gt;"files.content.write"&lt;/SPAN&gt;));&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which gives me a token, that then I store, and re-use the following time and also for the actual operation:&lt;/P&gt;
&lt;PRE&gt;DropboxClientFactory.&lt;SPAN&gt;init&lt;/SPAN&gt;(accessToken);&lt;BR /&gt;PicassoClient.&lt;SPAN&gt;init&lt;/SPAN&gt;(&lt;SPAN&gt;context&lt;/SPAN&gt;, DropboxClientFactory.&lt;SPAN&gt;getClient&lt;/SPAN&gt;());&lt;BR /&gt;DbxClientV2 mDbxClient = DropboxClientFactory.&lt;SPAN&gt;getClient&lt;/SPAN&gt;();&lt;BR /&gt;&lt;BR /&gt;mDbxClient.files().uploadBuilder(&lt;SPAN&gt;"/"&lt;/SPAN&gt;+&lt;SPAN&gt;recordingToExport&lt;/SPAN&gt;.getName()+&lt;SPAN&gt;"_Features.csv"&lt;/SPAN&gt;)&lt;BR /&gt;            .withMode(WriteMode.&lt;SPAN&gt;OVERWRITE&lt;/SPAN&gt;)&lt;BR /&gt;            .uploadAndFinish(inputStream);&lt;/PRE&gt;
&lt;P&gt;How does this code change when using short lived access tokens?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your documentation on github doesn't seem to use any of this, but obviously at the next call I get an error because the token expired.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 05:29:16 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-issues-with-short-lived-token/m-p/508280#M25098</guid>
      <dc:creator>marcoalt</dc:creator>
      <dc:date>2021-03-29T05:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: Java SDK issues with short lived token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-issues-with-short-lived-token/m-p/508693#M25109</link>
      <description>&lt;P&gt;The&amp;nbsp;startOAuth2PKCE method will automatically use short-lived access tokens and refresh tokens for you. You can find &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/3162efeccaca247e25553acd21f6ac0bf9018ad6/examples/android/src/main/java/com/dropbox/core/examples/android/DropboxActivity.java#L94" target="_self"&gt;an example of using that method here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When using that, you should save the "credential" (which contains both the access token and refresh token) instead of just the access token. You can see &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/3162efeccaca247e25553acd21f6ac0bf9018ad6/examples/android/src/main/java/com/dropbox/core/examples/android/DropboxActivity.java#L30" target="_self"&gt;an example of handling that here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 15:02:26 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-issues-with-short-lived-token/m-p/508693#M25109</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2021-03-29T15:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: Java SDK issues with short lived token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-issues-with-short-lived-token/m-p/519989#M25376</link>
      <description>&lt;P&gt;Hi, I am also looking to migrate to short-lived token. Thank-you for posting the usage examples.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One question I have is, if I update my code, using startOAuth2PKCE method, will that affect my &lt;EM&gt;Access Token Expiration&lt;/EM&gt; setting in appConsole (currently set to &lt;EM&gt;No Expiration&lt;/EM&gt;) for other apps accessing Dropbox? Basically I just want to make sure that if I start testing with startOAuth2PKCE method, that it won't affect my current apps and users in production, as, in addition to an Android app, I have an iOS app and a Java Desktop app as well (which I plan to migrate later).&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 02:20:33 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-issues-with-short-lived-token/m-p/519989#M25376</guid>
      <dc:creator>vewert</dc:creator>
      <dc:date>2021-05-13T02:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Java SDK issues with short lived token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-issues-with-short-lived-token/m-p/520113#M25379</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1648"&gt;@vewert&lt;/a&gt; No, just using the startOAuth2PKCE method will not change the "Access token expiration" setting in the App Console for any of your apps.&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 13:34:53 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-issues-with-short-lived-token/m-p/520113#M25379</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2021-05-13T13:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: Java SDK issues with short lived token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-issues-with-short-lived-token/m-p/520166#M25381</link>
      <description>&lt;P&gt;Thanks for your quick response, so using startOAuth2PKCE method with give a Short Term Token, even if my app console is set to &lt;EM&gt;No Expiration&lt;/EM&gt;?&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 17:34:06 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-issues-with-short-lived-token/m-p/520166#M25381</guid>
      <dc:creator>vewert</dc:creator>
      <dc:date>2021-05-13T17:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: Java SDK issues with short lived token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-issues-with-short-lived-token/m-p/520188#M25384</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1648"&gt;@vewert&lt;/a&gt; Yes, that's correct. The the "Access token expiration" setting in the App Console is essentially a setting that controls the default behavior when token_access_type is not specifically set by the app during the authorization flow. The startOAuth2PKCE does set that though, so it will still return a short-lived access token/refresh token.&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 18:33:51 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-issues-with-short-lived-token/m-p/520188#M25384</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2021-05-13T18:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: Java SDK issues with short lived token</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-issues-with-short-lived-token/m-p/520198#M25385</link>
      <description>&lt;P&gt;Ah, that clarifies things. Thank-you for your help, it is very appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 18:59:00 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-issues-with-short-lived-token/m-p/520198#M25385</guid>
      <dc:creator>vewert</dc:creator>
      <dc:date>2021-05-13T18:59:00Z</dc:date>
    </item>
  </channel>
</rss>

