<?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: how can I generate a resfresh token automatically, java web app in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/how-can-I-generate-a-resfresh-token-automatically-java-web-app/m-p/592140#M27511</link>
    <description>&lt;DIV class="lia-message-body-content"&gt;
&lt;P&gt;Dropbox is in the process of switching to only issuing short-lived access tokens (and optional refresh tokens) instead of long-lived access tokens. You can find &lt;A href="https://dropbox.tech/developers/migrating-app-permissions-and-access-tokens" target="_self" rel="nofollow noopener noreferrer"&gt;more information on this migration here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Apps can still get long-term access by requesting "offline" access though, in which case the app receives a "refresh token" that can be used to retrieve new short-lived access tokens as needed, without further manual user intervention. You can find more information in the &lt;A href="https://developers.dropbox.com/oauth-guide" target="_self" rel="noopener noreferrer"&gt;OAuth Guide&lt;/A&gt; and &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#authorization" target="_self" rel="noopener noreferrer"&gt;authorization documentation&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is not possible to fully automate the OAuth process where the user chooses to authorize the app and the app then receives the resulting access token and optional refresh token. This needs to be done manually by the user at least once. If your app needs to maintain long-term access without the user manually re-authorizing it repeatedly, the app should request "offline" access so that it gets a refresh token. The refresh token doesn't expire and can be stored and used repeatedly to get new short-lived access tokens whenever needed, without the user manually reauthorizing the app.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For reference, while the creation of new long-lived access tokens is now deprecated, we don't currently have a plan to disable existing long-lived access tokens. (If that changes, we will of course announce that ahead of time.) That being the case, you can continue using existing long-lived access token(s) without interruption, if you have any. Also, note though that after the change you won't be able to create new long-lived access tokens.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While the change began on September 30th 2021, we're releasing it gradually, so you may not have seen your app(s) affected until now. Once it applies to your app, it would apply regardless of the "Access token expiration" setting for your app, and that setting may no longer be available for your app.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's some example code of processing the authorization flow using the official Dropbox API v2 Java SDK, such as to get a refresh token: &lt;A href="https://github.com/dropbox/dropbox-sdk-java/tree/master/examples/authorize/src/main/java/com/dropbox/core/examples/authorize" target="_blank" rel="noopener"&gt;https://github.com/dropbox/dropbox-sdk-java/tree/master/examples/authorize/src/main/java/com/dropbox/core/examples/authorize&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For instance, here's a line where it requests "offline" access in order to get a refresh token: &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/authorize/src/main/java/com/dropbox/core/examples/authorize/ScopeAuthorize.java#L39" target="_blank" rel="noopener"&gt;https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/authorize/src/main/java/com/dropbox/core/examples/authorize/ScopeAuthorize.java#L39&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And here's an example of storing the refresh token: &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/authorize/src/main/java/com/dropbox/core/examples/authorize/Main.java#L98" target="_blank" rel="noopener"&gt;https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/authorize/src/main/java/com/dropbox/core/examples/authorize/Main.java#L98&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As long as you supply the necessary credentials, the SDK will then handle the refresh process for you automatically, e.g.: &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/e52fc828c7c753e04c3fa9d47ab6de7e85d000c4/examples/account-info/src/main/java/com/dropbox/core/examples/account_info/Main.java" target="_blank" rel="noopener"&gt;https://github.com/dropbox/dropbox-sdk-java/blob/e52fc828c7c753e04c3fa9d47ab6de7e85d000c4/examples/account-info/src/main/java/com/dropbox/core/examples/account_info/Main.java&lt;/A&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
    <pubDate>Wed, 20 Apr 2022 15:23:37 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2022-04-20T15:23:37Z</dc:date>
    <item>
      <title>how can I generate a resfresh token automatically, java web app</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/how-can-I-generate-a-resfresh-token-automatically-java-web-app/m-p/592022#M27508</link>
      <description>&lt;P&gt;Good Morning everyone,&lt;/P&gt;
&lt;P&gt;I have a question about my java web app and automatic refresh token generation:&lt;BR /&gt;&lt;BR /&gt;I have my access token and appName stored in application.properties file.&lt;/P&gt;
&lt;P&gt;After that, I have a configuration class that contains getter and setter of my properties.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally I hava a customized java class with different dropbox methods like login, update file, delete file, etc.&lt;BR /&gt;&lt;BR /&gt;After 30th September I can't have a long life access token, but I need to generate x times a refresh token and I don't know how to get it automatically and my question is:&lt;BR /&gt;Is there a method for generating the refresh token automatically?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;right away some code examples:&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;APPLICATION.PROPERTIES:&lt;/STRONG&gt;&lt;BR /&gt;application.dropbox.api.appName= myAppName&lt;BR /&gt;application.dropbox.api.accessToken= xxxxx&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;CONFIGURATION.JAVA:&lt;/STRONG&gt;&lt;BR /&gt;@Value("${application.dropbox.api.appName}")&lt;BR /&gt;private String dropboxAppName;&lt;BR /&gt;@Value("${application.dropbox.api.accessToken}")&lt;BR /&gt;private String dropboxAccessToken;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;DROPBOXUTILS.JAVA:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;public static DbxClientV2 getV2Client(SuiteConfiguration suiteConfiguration) {&lt;BR /&gt;DbxRequestConfig config = DbxRequestConfig.newBuilder("").withAutoRetryEnabled().withUserLocaleFromPreferences().build();&lt;BR /&gt;DbxClientV2 client = new DbxClientV2(config, suiteConfiguration.getDropboxAccessToken());&lt;BR /&gt;return client;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 16:47:22 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/how-can-I-generate-a-resfresh-token-automatically-java-web-app/m-p/592022#M27508</guid>
      <dc:creator>Lorenz096</dc:creator>
      <dc:date>2022-04-21T16:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: how can I generate a resfresh token automatically, java web app</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/how-can-I-generate-a-resfresh-token-automatically-java-web-app/m-p/592140#M27511</link>
      <description>&lt;DIV class="lia-message-body-content"&gt;
&lt;P&gt;Dropbox is in the process of switching to only issuing short-lived access tokens (and optional refresh tokens) instead of long-lived access tokens. You can find &lt;A href="https://dropbox.tech/developers/migrating-app-permissions-and-access-tokens" target="_self" rel="nofollow noopener noreferrer"&gt;more information on this migration here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Apps can still get long-term access by requesting "offline" access though, in which case the app receives a "refresh token" that can be used to retrieve new short-lived access tokens as needed, without further manual user intervention. You can find more information in the &lt;A href="https://developers.dropbox.com/oauth-guide" target="_self" rel="noopener noreferrer"&gt;OAuth Guide&lt;/A&gt; and &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#authorization" target="_self" rel="noopener noreferrer"&gt;authorization documentation&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is not possible to fully automate the OAuth process where the user chooses to authorize the app and the app then receives the resulting access token and optional refresh token. This needs to be done manually by the user at least once. If your app needs to maintain long-term access without the user manually re-authorizing it repeatedly, the app should request "offline" access so that it gets a refresh token. The refresh token doesn't expire and can be stored and used repeatedly to get new short-lived access tokens whenever needed, without the user manually reauthorizing the app.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For reference, while the creation of new long-lived access tokens is now deprecated, we don't currently have a plan to disable existing long-lived access tokens. (If that changes, we will of course announce that ahead of time.) That being the case, you can continue using existing long-lived access token(s) without interruption, if you have any. Also, note though that after the change you won't be able to create new long-lived access tokens.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While the change began on September 30th 2021, we're releasing it gradually, so you may not have seen your app(s) affected until now. Once it applies to your app, it would apply regardless of the "Access token expiration" setting for your app, and that setting may no longer be available for your app.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's some example code of processing the authorization flow using the official Dropbox API v2 Java SDK, such as to get a refresh token: &lt;A href="https://github.com/dropbox/dropbox-sdk-java/tree/master/examples/authorize/src/main/java/com/dropbox/core/examples/authorize" target="_blank" rel="noopener"&gt;https://github.com/dropbox/dropbox-sdk-java/tree/master/examples/authorize/src/main/java/com/dropbox/core/examples/authorize&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For instance, here's a line where it requests "offline" access in order to get a refresh token: &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/authorize/src/main/java/com/dropbox/core/examples/authorize/ScopeAuthorize.java#L39" target="_blank" rel="noopener"&gt;https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/authorize/src/main/java/com/dropbox/core/examples/authorize/ScopeAuthorize.java#L39&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And here's an example of storing the refresh token: &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/authorize/src/main/java/com/dropbox/core/examples/authorize/Main.java#L98" target="_blank" rel="noopener"&gt;https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/authorize/src/main/java/com/dropbox/core/examples/authorize/Main.java#L98&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As long as you supply the necessary credentials, the SDK will then handle the refresh process for you automatically, e.g.: &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/e52fc828c7c753e04c3fa9d47ab6de7e85d000c4/examples/account-info/src/main/java/com/dropbox/core/examples/account_info/Main.java" target="_blank" rel="noopener"&gt;https://github.com/dropbox/dropbox-sdk-java/blob/e52fc828c7c753e04c3fa9d47ab6de7e85d000c4/examples/account-info/src/main/java/com/dropbox/core/examples/account_info/Main.java&lt;/A&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 20 Apr 2022 15:23:37 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/how-can-I-generate-a-resfresh-token-automatically-java-web-app/m-p/592140#M27511</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-04-20T15:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: how can I generate a resfresh token automatically, java web app</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/how-can-I-generate-a-resfresh-token-automatically-java-web-app/m-p/592266#M27523</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/10"&gt;@Greg-DB&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;DIV class=""&gt;&lt;P&gt;Dropbox is in the process of switching to only issuing short-lived access tokens (and optional refresh tokens) instead of long-lived access tokens. You can find &lt;A href="https://dropbox.tech/developers/migrating-app-permissions-and-access-tokens" target="_self" rel="nofollow noopener noreferrer"&gt;more information on this migration here&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apps can still get long-term access by requesting "offline" access though, in which case the app receives a "refresh token" that can be used to retrieve new short-lived access tokens as needed, without further manual user intervention. You can find more information in the &lt;A href="https://developers.dropbox.com/oauth-guide" target="_self" rel="noopener noreferrer"&gt;OAuth Guide&lt;/A&gt; and &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#authorization" target="_self" rel="noopener noreferrer"&gt;authorization documentation&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is not possible to fully automate the OAuth process where the user chooses to authorize the app and the app then receives the resulting access token and optional refresh token. This needs to be done manually by the user at least once. If your app needs to maintain long-term access without the user manually re-authorizing it repeatedly, the app should request "offline" access so that it gets a refresh token. The refresh token doesn't expire and can be stored and used repeatedly to get new short-lived access tokens whenever needed, without the user manually reauthorizing the app.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For reference, while the creation of new long-lived access tokens is now deprecated, we don't currently have a plan to disable existing long-lived access tokens. (If that changes, we will of course announce that ahead of time.) That being the case, you can continue using existing long-lived access token(s) without interruption, if you have any. Also, note though that after the change you won't be able to create new long-lived access tokens.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While the change began on September 30th 2021, we're releasing it gradually, so you may not have seen your app(s) affected until now. Once it applies to your app, it would apply regardless of the "Access token expiration" setting for your app, and that setting may no longer be available for your app.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's some example code of processing the authorization flow using the official Dropbox API v2 Java SDK, such as to get a refresh token: &lt;A href="https://github.com/dropbox/dropbox-sdk-java/tree/master/examples/authorize/src/main/java/com/dropbox/core/examples/authorize" target="_blank" rel="noopener"&gt;https://github.com/dropbox/dropbox-sdk-java/tree/master/examples/authorize/src/main/java/com/dropbox/core/examples/authorize&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For instance, here's a line where it requests "offline" access in order to get a refresh token: &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/authorize/src/main/java/com/dropbox/core/examples/authorize/ScopeAuthorize.java#L39" target="_blank" rel="noopener"&gt;https://github.com/dropbox/dropbox-sdk-java/blob/master/examples/authorize/src/main/java/com/dropbox/core/examples/authorize/ScopeAuthorize.java#L39&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And here's an example of storing the refresh token: &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/apk%20master/examples/authorize/src/main/java/com/dropbox/core/examples/authorize/Main.java#L98" target="_self"&gt;https://github.com/dropbox/dropbox-sdk-java/blob/&lt;/A&gt;&lt;A href="https://apkkernal.com/filmorago-mod-apk/" target="_self"&gt;filmorago-premium-apk&lt;/A&gt;&lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/apk%20master/examples/authorize/src/main/java/com/dropbox/core/examples/authorize/Main.java#L98" target="_self"&gt;/examples/authorize/src/main/java/com/dropbox/core/examples/authorize/Main.java#L98&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As long as you supply the necessary credentials, the SDK will then handle the refresh process for you automatically, e.g.: &lt;A href="https://github.com/dropbox/dropbox-sdk-java/blob/e52fc828c7c753e04c3fa9d47ab6de7e85d000c4/examples/account-info/src/main/java/com/dropbox/core/examples/account_info/Main.java" target="_blank" rel="noopener"&gt;https://github.com/dropbox/dropbox-sdk-java/blob/e52fc828c7c753e04c3fa9d47ab6de7e85d000c4/examples/account-info/src/main/java/com/dropbox/core/examples/account_info/Main.java&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Thank you so much for explaining it in detail.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 15:41:04 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/how-can-I-generate-a-resfresh-token-automatically-java-web-app/m-p/592266#M27523</guid>
      <dc:creator>Jamesbond0071</dc:creator>
      <dc:date>2022-06-10T15:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: how can I generate a resfresh token automatically, java web app</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/how-can-I-generate-a-resfresh-token-automatically-java-web-app/m-p/592363#M27530</link>
      <description>&lt;P&gt;Thank you for supporting, I'm going to do that!&lt;/P&gt;</description>
      <pubDate>Thu, 21 Apr 2022 08:23:25 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/how-can-I-generate-a-resfresh-token-automatically-java-web-app/m-p/592363#M27530</guid>
      <dc:creator>Lorenz096</dc:creator>
      <dc:date>2022-04-21T08:23:25Z</dc:date>
    </item>
  </channel>
</rss>

