<?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 OAuth2 one token for differet interfaces in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/OAuth2-one-token-for-differet-interfaces/m-p/248440#M14255</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with APIv1 I have build an App wich runs in java on different machines.&amp;nbsp;The App is&amp;nbsp;linked with a speacial dropbox folder so that the app hase the same file basis on every machine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How could I build this with the APIv2 without copy the token everytime on a new machine?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I have only one token to access my dropbox. If I generate one with the Java SDK I can use it. Now I switch to the other &lt;SPAN&gt;machine&amp;nbsp;&lt;/SPAN&gt;at work and the app does not know any token. So it will try to generate a new token. Now switch to the other &lt;SPAN&gt;machine&amp;nbsp;&lt;/SPAN&gt;and the token is not longer working. &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@B0F70D28791EB05FA3EA0C3BDDF08EE3/emoticons/1f61e.png" alt=":disappointed_face:" title=":disappointed_face:" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope you can understand my problem. Have you any Solution?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:17:58 GMT</pubDate>
    <dc:creator>thorty</dc:creator>
    <dc:date>2019-05-29T09:17:58Z</dc:date>
    <item>
      <title>OAuth2 one token for differet interfaces</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/OAuth2-one-token-for-differet-interfaces/m-p/248440#M14255</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;with APIv1 I have build an App wich runs in java on different machines.&amp;nbsp;The App is&amp;nbsp;linked with a speacial dropbox folder so that the app hase the same file basis on every machine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How could I build this with the APIv2 without copy the token everytime on a new machine?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now I have only one token to access my dropbox. If I generate one with the Java SDK I can use it. Now I switch to the other &lt;SPAN&gt;machine&amp;nbsp;&lt;/SPAN&gt;at work and the app does not know any token. So it will try to generate a new token. Now switch to the other &lt;SPAN&gt;machine&amp;nbsp;&lt;/SPAN&gt;and the token is not longer working. &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@B0F70D28791EB05FA3EA0C3BDDF08EE3/emoticons/1f61e.png" alt=":disappointed_face:" title=":disappointed_face:" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope you can understand my problem. Have you any Solution?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:17:58 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/OAuth2-one-token-for-differet-interfaces/m-p/248440#M14255</guid>
      <dc:creator>thorty</dc:creator>
      <dc:date>2019-05-29T09:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: OAuth2 one token for differet interfaces</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/OAuth2-one-token-for-differet-interfaces/m-p/248462#M14261</link>
      <description>API v1 and API v2 should work the same way in this regard. You can use the same OAuth 2 access token from multiple instances of the same app, or you can create and use multiple different access tokens. Creating additional access tokens does not invalidate previous access tokens.&lt;BR /&gt;&lt;BR /&gt;If something isn't working as expected, please share a sample request and unexpected response. (Be sure to redact the access token itself though.)</description>
      <pubDate>Sat, 21 Oct 2017 14:17:38 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/OAuth2-one-token-for-differet-interfaces/m-p/248462#M14261</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-10-21T14:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: OAuth2 one token for differet interfaces</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/OAuth2-one-token-for-differet-interfaces/m-p/248599#M14270</link>
      <description>&lt;P&gt;Thanks Greg,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt;or you can create and use multiple different access tokens" - that would be great!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use the Java API SDK. Can you tell my how I can get an existing token or generate an additional token? Whenever I creat a "new" token the older token does not working anymore and an "invalid access token" exception is thrown.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my code to generate a new token:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;public static String doAuth() {

        // Only display important log messages.
        Logger.getLogger("").setLevel(Level.WARNING);

        // Read app info file (contains app key and app secret)
        DbxAppInfo appInfo;
        appInfo = new DbxAppInfo(APP_KEY, APP_SECRET);

        // Run through Dropbox API authorization process
        DbxRequestConfig requestConfig = new DbxRequestConfig("foo");
        DbxWebAuth webAuth = new DbxWebAuth(requestConfig, appInfo);
        
        
        DbxWebAuth.Request webAuthRequest = DbxWebAuth.newRequestBuilder()
                .withNoRedirect()
                .withForceReapprove(Boolean.FALSE)
                .build();

        String authorizeUrl = webAuth.authorize(webAuthRequest);
        System.out.println("1. Go to " + authorizeUrl);
        System.out.println("2. Click \"Allow\" (you might have to log in first).");
        System.out.println("3. Copy the authorization code.");
        System.out.print("Enter the authorization code here: ");

        String code = null;
        try {
            code = new BufferedReader(new InputStreamReader(System.in)).readLine();
        } catch (IOException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }
        if (code == null) {
            System.exit(1);
            return null;
        }
        code = code.trim();

        DbxAuthFinish authFinish;
        try {
            authFinish = webAuth.finishFromCode(code);
        } catch (DbxException ex) {
            System.err.println("Error in DbxWebAuth.authorize: " + ex.getMessage());
            System.exit(1);
            return null;
        }

        System.out.println("Authorization complete.");
        System.out.println("- User ID: " + authFinish.getUserId());
        System.out.println("- Access Token: " + authFinish.getAccessToken());

        // Save auth information to output file.
        DbxAuthInfo authInfo = new DbxAuthInfo(authFinish.getAccessToken(), appInfo.getHost());
        File output = new File("token");
        try {
            DbxAuthInfo.Writer.writeToFile(authInfo, output);
            System.out.println("Saved authorization information to \"" + output.getCanonicalPath() + "\".");
        } catch (IOException ex) {
            System.err.println("Error saving to &amp;lt;auth-file-out&amp;gt;: " + ex.getMessage());
            System.err.println("Dumping to stderr instead:");
            try {
                DbxAuthInfo.Writer.writeToStream(authInfo, System.err);
            } catch (IOException ex1) {
                Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex1);
            }
        }

        return authFinish.getAccessToken();
    }&lt;/PRE&gt;</description>
      <pubDate>Sun, 22 Oct 2017 09:06:12 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/OAuth2-one-token-for-differet-interfaces/m-p/248599#M14270</guid>
      <dc:creator>thorty</dc:creator>
      <dc:date>2017-10-22T09:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: OAuth2 one token for differet interfaces</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/OAuth2-one-token-for-differet-interfaces/m-p/248634#M14276</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/517411"&gt;@thorty&lt;/a&gt;&amp;nbsp;Using the&amp;nbsp;DbxWebAuth flow you have is a valid way to get another access token, and that shouldn't revoke any previous tokens&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you elaborate on the issue you're having with the previous token? E.g., please share the code and full output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make sure you're not mixing up the "authorization code" and "access token". The authorization code is single-use only, and can exchanged for an access token once. The resulting access token can be stored and re-used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are other ways tokens can be revoked too, so make sure you're not accidentally doing any of the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL type="disc"&gt;
&lt;LI type="disc"&gt;by the user unlinking the app via their account security page:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://www.dropbox.com/account/security" rel="noreferrer" target="_blank"&gt;https://www.dropbox.com/account/security&lt;/A&gt;&lt;/LI&gt;
&lt;LI type="disc"&gt;by deleting the app folder, if the app uses the app folder permission&lt;/LI&gt;
&lt;LI type="disc"&gt;by the app revoking the access token via the tokenRevoke method:&amp;nbsp;&lt;SPAN&gt; &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/auth/DbxUserAuthRequests.html#tokenRevoke--" target="_self"&gt;https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/auth/DbxUserAuthRequests.html#tokenRevoke--&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI type="disc"&gt;by disabling the user account&lt;/LI&gt;
&lt;LI type="disc"&gt;by disabling the API app&lt;/LI&gt;
&lt;LI type="disc"&gt;by disabling the app owner's account&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Sun, 22 Oct 2017 14:42:09 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/OAuth2-one-token-for-differet-interfaces/m-p/248634#M14276</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-10-22T14:42:09Z</dc:date>
    </item>
  </channel>
</rss>

