<?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 to get OAuth2 access token from OAuth1 token and secret with API v2 in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-OAuth2-access-token-from-OAuth1-token-and-secret-with/m-p/213232#M10832</link>
    <description>&lt;P&gt;Thanks for letting us know, Steve. This should be updated now!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let us know if you run into any issues migrating.&lt;/P&gt;</description>
    <pubDate>Sat, 25 Mar 2017 02:42:27 GMT</pubDate>
    <dc:creator>Stephen C.14</dc:creator>
    <dc:date>2017-03-25T02:42:27Z</dc:date>
    <item>
      <title>How to get OAuth2 access token from OAuth1 token and secret with API v2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-OAuth2-access-token-from-OAuth1-token-and-secret-with/m-p/200701#M9433</link>
      <description>&lt;P&gt;All current users of our mobile app have OAuth1 token and secret stored for using their Dropbox account. &amp;nbsp;With the migration to API v2, we must use OAuth2 access tokens. &amp;nbsp;How can the OAuth1 token and secret be converted to an OAuth2 access token? The API v2 provides a route called /token/from_oauth1 which seems to provide a means to do this, but it requires an OAuth2 access token in order to work. &amp;nbsp;That makes no sense to me since&amp;nbsp;it seems to require that you already have the answer in order to ask the question. &amp;nbsp;How can /token/from_oauth1 be used? And how can we convert our OAuth1 tokens and secrets to OAuth2 access tokens?&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:27:03 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-OAuth2-access-token-from-OAuth1-token-and-secret-with/m-p/200701#M9433</guid>
      <dc:creator>Daniel A.39</dc:creator>
      <dc:date>2019-05-29T09:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to get OAuth2 access token from OAuth1 token and secret with API v2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-OAuth2-access-token-from-OAuth1-token-and-secret-with/m-p/200711#M9436</link>
      <description>&lt;P&gt;That is the right way to do&amp;nbsp;this, but it looks like the curl example in the documentation for &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#auth-token-from_oauth1" target="_self"&gt;/2/auth/token/from_oauth1&lt;/A&gt;&amp;nbsp;is unfortunately incorrect. I'll let the team know to fix that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That endpoint actually uses &lt;A href="https://www.dropbox.com/developers/reference/auth-types#app" target="_self"&gt;app authentication&lt;/A&gt;, so an OAuth 2 access token isn't necessary. This is what the curl example should look like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;curl -X POST https://api.dropboxapi.com/2/auth/token/from_oauth1 \
    -u "APP_KEY:APP_SECRET" \
    --header "Content-Type: application/json" \
    --data "{\"oauth1_token\": \"OAUTH1_TOKEN_KEY\",\"oauth1_token_secret\": \"OAUTH1_TOKEN_SECRET\"}"&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Jan 2017 21:13:09 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-OAuth2-access-token-from-OAuth1-token-and-secret-with/m-p/200711#M9436</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-01-05T21:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to get OAuth2 access token from OAuth1 token and secret with API v2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-OAuth2-access-token-from-OAuth1-token-and-secret-with/m-p/200725#M9444</link>
      <description>Thanks, Greg. That's great. I drilled down to the HTTP API to try to get to the bottom of it, but I really should have asked about the Objective C API, since that's what I use. In that case it looks like I need to call a method on the AUTHRoute object, but I don't see a way to get one of those without a DropboxClient, which requires authentication. Can you give a quick example for Objective C? Thanks!</description>
      <pubDate>Thu, 05 Jan 2017 22:14:45 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-OAuth2-access-token-from-OAuth1-token-and-secret-with/m-p/200725#M9444</guid>
      <dc:creator>Daniel A.39</dc:creator>
      <dc:date>2017-01-05T22:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to get OAuth2 access token from OAuth1 token and secret with API v2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-OAuth2-access-token-from-OAuth1-token-and-secret-with/m-p/200729#M9445</link>
      <description>&lt;P&gt;No problem, that would look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;[DropboxClientsManager setupWithAppKey:@"APP_KEY"];

DBTransportClient *transportClient = [[DBTransportClient alloc] initWithAccessToken:nil
                                                                         selectUser:nil
                                                                          baseHosts:nil
                                                                          userAgent:nil
                                                                backgroundSessionId:nil
                                                                      delegateQueue:nil
                                                                             appKey:@"APP_KEY"
                                                                          appSecret:@"APP_SECRET"];
[DropboxClientsManager authorizedClient:[[DropboxClient alloc] initWithTransportClient:transportClient]];&lt;/PRE&gt;
&lt;PRE&gt;[[DropboxClientsManager.authorizedClient.authRoutes tokenFromOauth1:@"OAUTH1_TOKEN_KEY" oauth1TokenSecret:@"OAUTH1_TOKEN_SECRET"] response:^(DBAUTHTokenFromOAuth1Result *result, DBAUTHTokenFromOAuth1Error *routeError, DBRequestError *error) {
    if (result) {
        NSLog(@"OAuth 2 access token: %@\n", result.oauth2Token);
    } else {
        NSLog(@"%@\n%@\n", routeError, error);
    }
}];&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Jan 2017 22:52:23 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-OAuth2-access-token-from-OAuth1-token-and-secret-with/m-p/200729#M9445</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-01-05T22:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to get OAuth2 access token from OAuth1 token and secret with API v2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-OAuth2-access-token-from-OAuth1-token-and-secret-with/m-p/200737#M9448</link>
      <description>&lt;P&gt;That is great! Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jan 2017 00:33:18 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-OAuth2-access-token-from-OAuth1-token-and-secret-with/m-p/200737#M9448</guid>
      <dc:creator>Daniel A.39</dc:creator>
      <dc:date>2017-01-06T00:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to get OAuth2 access token from OAuth1 token and secret with API v2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-OAuth2-access-token-from-OAuth1-token-and-secret-with/m-p/212597#M10774</link>
      <description>&lt;P&gt;Can you point us to an example of using this with the new 3.0 SDK changes mentioned in&amp;nbsp;&lt;A href="https://github.com/dropbox/dropbox-sdk-obj-c/releases/tag/3.0.0" target="_blank"&gt;https://github.com/dropbox/dropbox-sdk-obj-c/releases/tag/3.0.0&lt;/A&gt; ?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2017 05:12:24 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-OAuth2-access-token-from-OAuth1-token-and-secret-with/m-p/212597#M10774</guid>
      <dc:creator>Steve L.</dc:creator>
      <dc:date>2017-03-21T05:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to get OAuth2 access token from OAuth1 token and secret with API v2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-OAuth2-access-token-from-OAuth1-token-and-secret-with/m-p/212651#M10782</link>
      <description>&lt;P&gt;In the latest version of the SDK, the equivalent code would be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;DBTransportDefaultConfig *transportClient = [[DBTransportDefaultConfig alloc] initWithAppKey:@"APP_KEY" appSecret:@"APP_SECRET"];

[DBClientsManager setupWithTransportConfig:transportClient];&lt;/PRE&gt;
&lt;PRE&gt;[[DBClientsManager.authorizedClient.authRoutes tokenFromOauth1:@"OAUTH1_TOKEN_KEY" oauth1TokenSecret:@"OAUTH1_TOKEN_SECRET"] setResponseBlock:^(DBAUTHTokenFromOAuth1Result *response, DBAUTHTokenFromOAuth1Error *routeError, DBRequestError * error) {
    if (response) {
        NSLog(@"OAuth 2 access token: %@\n", response.oauth2Token);
    } else {
        NSLog(@"%@\n%@\n", routeError, error);
    }
}];
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are migrating from an old official SDK though, we recently added a helper that can automatically migrate those stored tokens:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/dropbox/dropbox-sdk-obj-c#migrating-from-api-v1" target="_self"&gt;https://github.com/dropbox/dropbox-sdk-obj-c#migrating-from-api-v1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Mar 2017 16:30:56 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-OAuth2-access-token-from-OAuth1-token-and-secret-with/m-p/212651#M10782</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-03-21T16:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to get OAuth2 access token from OAuth1 token and secret with API v2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-OAuth2-access-token-from-OAuth1-token-and-secret-with/m-p/213118#M10819</link>
      <description>&lt;P&gt;Thanks Greg, that last link helps a lot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BTW, there's a typo in&amp;nbsp;Migrating OAuth tokens from earlier SDKs, in the&amp;nbsp;unsuccessfullyMigratedTokenData code. The&amp;nbsp;format either has an extra %@ at the start or there is a missing argument.&lt;/P&gt;&lt;PRE&gt;      &lt;SPAN class="pl-c1"&gt;NSLog&lt;/SPAN&gt;(&lt;SPAN class="pl-s"&gt;&lt;SPAN class="pl-pds"&gt;@"&lt;/SPAN&gt;&lt;SPAN class="pl-c1"&gt;%@&lt;/SPAN&gt;DropboxUserID: &lt;SPAN class="pl-c1"&gt;%@&lt;/SPAN&gt;, AccessToken: &lt;SPAN class="pl-c1"&gt;%@&lt;/SPAN&gt;, AccessTokenSecret: &lt;SPAN class="pl-c1"&gt;%@&lt;/SPAN&gt;, StoredAppKey: &lt;SPAN class="pl-c1"&gt;%@&lt;/SPAN&gt;&lt;SPAN class="pl-pds"&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;, tokenData[&lt;SPAN class="pl-c1"&gt;0&lt;/SPAN&gt;],&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 02:00:41 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-OAuth2-access-token-from-OAuth1-token-and-secret-with/m-p/213118#M10819</guid>
      <dc:creator>Steve L.</dc:creator>
      <dc:date>2017-03-24T02:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to get OAuth2 access token from OAuth1 token and secret with API v2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-OAuth2-access-token-from-OAuth1-token-and-secret-with/m-p/213232#M10832</link>
      <description>&lt;P&gt;Thanks for letting us know, Steve. This should be updated now!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let us know if you run into any issues migrating.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Mar 2017 02:42:27 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-OAuth2-access-token-from-OAuth1-token-and-secret-with/m-p/213232#M10832</guid>
      <dc:creator>Stephen C.14</dc:creator>
      <dc:date>2017-03-25T02:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to get OAuth2 access token from OAuth1 token and secret with API v2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-OAuth2-access-token-from-OAuth1-token-and-secret-with/m-p/221724#M11783</link>
      <description>&lt;P&gt;Hi, I'm also working on migrating from API v1 to v2.&amp;nbsp; Do I have to migrate the existing tokens over in order for v2 to work?&amp;nbsp;&amp;nbsp; Can I just set up v2 from scratch and then just ask my users to re-link to Dropbox when needed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 17 May 2017 21:11:33 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-OAuth2-access-token-from-OAuth1-token-and-secret-with/m-p/221724#M11783</guid>
      <dc:creator>ElizabethW</dc:creator>
      <dc:date>2017-05-17T21:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to get OAuth2 access token from OAuth1 token and secret with API v2</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-OAuth2-access-token-from-OAuth1-token-and-secret-with/m-p/221728#M11786</link>
      <description>Migrating existing access tokens is not required. You can have your users relink if you'd prefer.</description>
      <pubDate>Wed, 17 May 2017 21:22:45 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-get-OAuth2-access-token-from-OAuth1-token-and-secret-with/m-p/221728#M11786</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-05-17T21:22:45Z</dc:date>
    </item>
  </channel>
</rss>

