<?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: is there any Java sdk method to generate access token on the run by taking app key and app secre in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/is-there-any-Java-sdk-method-to-generate-access-token-on-the-run/m-p/697595#M31163</link>
    <description>&lt;P&gt;the links are dead. Please update.&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jul 2023 06:08:12 GMT</pubDate>
    <dc:creator>Thang2000</dc:creator>
    <dc:date>2023-07-10T06:08:12Z</dc:date>
    <item>
      <title>is there any Java sdk method to generate access token on the run by taking app key and app secret??</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/is-there-any-Java-sdk-method-to-generate-access-token-on-the-run/m-p/598244#M27798</link>
      <description>&lt;P&gt;Hello Dropbox team,&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;As Access token is expiring every 4 hours, we have to regenerate them every 4 hrs. This is becoming difficult to update the access code in my script manually. I'm looking for a &lt;STRONG&gt;Java SDK method that generate access token automatically every 4 hours by taking app key/app secret&lt;/STRONG&gt;&amp;nbsp;as input parameters. Could you suggest any sdk method or code sample that I can use to generate access token on the run in my script using app key/app secret.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Any help would be highly appreciated !!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 09:14:56 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/is-there-any-Java-sdk-method-to-generate-access-token-on-the-run/m-p/598244#M27798</guid>
      <dc:creator>Reshma</dc:creator>
      <dc:date>2022-05-20T09:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: is there any Java sdk method to generate access token on the run by taking app key and app secre</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/is-there-any-Java-sdk-method-to-generate-access-token-on-the-run/m-p/598256#M27799</link>
      <description>&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1541480"&gt;@Reshma &lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Every supported SDK do this automatically byself (without any additional method/function call). You just have to initialize your client object using refresh token instead of access token. &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@41457EF40051AFF130FDBFE21B496926/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt; That's it.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 07:42:31 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/is-there-any-Java-sdk-method-to-generate-access-token-on-the-run/m-p/598256#M27799</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2022-05-20T07:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: is there any Java sdk method to generate access token on the run by taking app key and app secre</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/is-there-any-Java-sdk-method-to-generate-access-token-on-the-run/m-p/598270#M27800</link>
      <description>&lt;P&gt;Thanks for the suggestion. I have created a Refresh token using this curl&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;curl &lt;/SPAN&gt;&lt;A href="https://api.dropbox.com/oauth2/token" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;https://api.dropbox.com/oauth2/token&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt; -d code=&amp;lt;receivedcode&amp;gt;-d grant_type=authorization_code -u &amp;lt;Appkey&amp;gt;:&amp;lt;Appsecret&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Then I have initialized/created drop box client object with Refresh token in place of access token&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;private static final String REFRESH_TOKEN = "&amp;lt;REDACTED_REFRESH_TOKEN&amp;gt; -u &amp;lt;REDACTED_APP_KEY&amp;gt;:&amp;lt;REDACTED_APP_SECRET&amp;gt;";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;// Create drop box client&lt;/P&gt;
&lt;P&gt;DbxRequestConfig config = DbxRequestConfig.newBuilder("dropbox/AppToCreateIT's").build();&lt;BR /&gt;DbxClientV2 client = new DbxClientV2(config, REFRESH_TOKEN);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But unfortunately this dint work, it is throwing below error&lt;BR /&gt;Invalid authorization value in HTTP header "Authorization": "Bearer &amp;lt;REDACTED_REFRESH_TOKEN&amp;gt; -u &amp;lt;REDACTED_APP_KEY&amp;gt;:&amp;lt;REDACTED_APP_SECRET&amp;gt;". Expecting "Bearer &amp;lt;oauth2-access-token&amp;gt;".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;pardon If my understanding is wrong , could you please guide me with the exact steps to be followed?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have taken the below reference to create dropbox client. instead of access token I have used refresh token as per your suggestion&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/dropbox/dropbox-sdk-java#:~:text=%20Dropbox%20Core%20SDK%20for%20Java%20%201,to%20get%20a%20%22test.auth%22%20file.%20%20More%20?msclkid=f59eb3b9cf5811ec81e61cf7f025142e" target="_blank" rel="noopener"&gt;GitHub - dropbox/dropbox-sdk-java: A Java library for the Dropbox Core API.&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 May 2022 13:08:13 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/is-there-any-Java-sdk-method-to-generate-access-token-on-the-run/m-p/598270#M27800</guid>
      <dc:creator>Reshma</dc:creator>
      <dc:date>2022-05-20T13:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: is there any Java sdk method to generate access token on the run by taking app key and app secre</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/is-there-any-Java-sdk-method-to-generate-access-token-on-the-run/m-p/598279#M27801</link>
      <description>&lt;P&gt;Hi again &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1541480"&gt;@Reshma &lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Seems you have misunderstood me. You can't just place one type of token where other type is expected! In Java SDK a &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/main/dropbox-sdk-java/src/main/java/com/dropbox/core/oauth/DbxCredential.java#L85" target="_blank" rel="noopener"&gt;DbxCredential&lt;/A&gt; object should be used as a proxy (don't ask me why) for refresh token.&lt;/P&gt;&lt;P&gt;Hope it's a bit more clear now.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 12:53:31 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/is-there-any-Java-sdk-method-to-generate-access-token-on-the-run/m-p/598279#M27801</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2023-07-10T12:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: is there any Java sdk method to generate access token on the run by taking app key and app secre</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/is-there-any-Java-sdk-method-to-generate-access-token-on-the-run/m-p/598362#M27805</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1541480"&gt;@Reshma &lt;/a&gt; As Здравко indicated, you cannot use a refresh token as an access token. Refresh tokens and access tokens serve different purposes and are not interchangeable. You can find &lt;A href="https://github.com/dropbox/dropbox-sdk-java/tree/main/examples/examples/src/main/java/com/dropbox/core/examples/authorize" target="_self"&gt;examples of using the authorization flow in the Java SDK here&lt;/A&gt;. You can find &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/main/examples/examples/src/main/java/com/dropbox/core/examples/account_info/AccountInfoExample.kt" target="_self"&gt;an example of using a credential with a client to make call here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, for future reference, do not publicly post your refresh token or app secret. I've redacted them from your post. You may want to revoke it for the sake of security.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 15:14:02 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/is-there-any-Java-sdk-method-to-generate-access-token-on-the-run/m-p/598362#M27805</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2023-07-12T15:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: is there any Java sdk method to generate access token on the run by taking app key and app secre</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/is-there-any-Java-sdk-method-to-generate-access-token-on-the-run/m-p/598676#M27813</link>
      <description>Thanks. This helps.</description>
      <pubDate>Mon, 23 May 2022 09:14:34 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/is-there-any-Java-sdk-method-to-generate-access-token-on-the-run/m-p/598676#M27813</guid>
      <dc:creator>Reshma</dc:creator>
      <dc:date>2022-05-23T09:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: is there any Java sdk method to generate access token on the run by taking app key and app secre</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/is-there-any-Java-sdk-method-to-generate-access-token-on-the-run/m-p/697595#M31163</link>
      <description>&lt;P&gt;the links are dead. Please update.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 06:08:12 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/is-there-any-Java-sdk-method-to-generate-access-token-on-the-run/m-p/697595#M31163</guid>
      <dc:creator>Thang2000</dc:creator>
      <dc:date>2023-07-10T06:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: is there any Java sdk method to generate access token on the run by taking app key and app secre</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/is-there-any-Java-sdk-method-to-generate-access-token-on-the-run/m-p/698282#M31184</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1710958"&gt;@Thang2000&lt;/a&gt; Thanks for letting us know! I've updated the links in my previous post.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2023 15:14:17 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/is-there-any-Java-sdk-method-to-generate-access-token-on-the-run/m-p/698282#M31184</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2023-07-12T15:14:17Z</dc:date>
    </item>
  </channel>
</rss>

