<?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: 400 BadRequest from .Net client when using refresh tokens in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/400-BadRequest-from-Net-client-when-using-refresh-tokens/m-p/588509#M27406</link>
    <description>&lt;P&gt;Please I am doing everything send by the support team step by step but no luck.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Apr 2022 15:53:26 GMT</pubDate>
    <dc:creator>Intellicode Mangement Systems</dc:creator>
    <dc:date>2022-04-05T15:53:26Z</dc:date>
    <item>
      <title>400 BadRequest from .Net client when using refresh tokens</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/400-BadRequest-from-Net-client-when-using-refresh-tokens/m-p/583067#M27163</link>
      <description>&lt;P&gt;We are using the .Net SDK client vs 6.14. We primarily use the Files.GetMetadataSync and Files.SaveUrlAsync api calls. We call the API with a variety of long-lived accessTokens and refreshTokens depending on when our customer initiated their Dropbox connection with us. On a number of recent customers who we setup with refreshTokens, we receive a 400 BadRequest HttpRequestException on every API call we make. We configure the DropboxClient with the refreshToken and our AppKey and AppSecret, leaving the accessToken handling up to the DropboxClient. From the returned stack trace, we see the 400 BadRequest is NOT coming in regards to our API call, but rather from the internal oauth calls the library is making to get an AccessToken.&lt;BR /&gt;&lt;BR /&gt;Can you tell us why we are getting the 400 BadRequest from internal oauth calls and what we can do to rectify it?&lt;BR /&gt;&lt;BR /&gt;Here is the stack trace:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;at HttpResponseMessage System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;at async Task&amp;lt;bool&amp;gt; Dropbox.Api.DropboxRequestHandler.RefreshAccessToken(string[] scopeList)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;at async Task&amp;lt;bool&amp;gt; Dropbox.Api.DropboxRequestHandler.CheckAndRefreshAccessToken()&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;at async Task&amp;lt;Result&amp;gt; Dropbox.Api.DropboxRequestHandler.RequestJsonStringWithRetry(string host, string routeName, string auth, RouteStyle routeStyle, string requestArg, Stream body)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;at async Task&amp;lt;TResponse&amp;gt; Dropbox.Api.DropboxRequestHandler.Dropbox.Api.Stone.ITransport.SendRpcRequestAsync&amp;lt;TRequest, TResponse, TError&amp;gt;(TRequest request, string host, string route, string auth, IEncoder&amp;lt;TRequest&amp;gt; requestEncoder, IDecoder&amp;lt;TResponse&amp;gt; responseDecoder, IDecoder&amp;lt;TError&amp;gt; errorDecoder)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;at async Task&amp;lt;SaveUrlResponse&amp;gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 19:32:09 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/400-BadRequest-from-Net-client-when-using-refresh-tokens/m-p/583067#M27163</guid>
      <dc:creator>jfreer</dc:creator>
      <dc:date>2022-03-11T19:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: 400 BadRequest from .Net client when using refresh tokens</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/400-BadRequest-from-Net-client-when-using-refresh-tokens/m-p/583092#M27164</link>
      <description>&lt;P&gt;There are a number of scenarios that can cause the refresh to fail like this, such as:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;missing/incorrect/malformed refresh token&lt;/LI&gt;
&lt;LI&gt;revoked refresh token (e.g., when the user unlinks the app via &lt;A href="https://www.dropbox.com/account/connected_apps" target="_blank"&gt;https://www.dropbox.com/account/connected_apps&lt;/A&gt; , etc.)&lt;/LI&gt;
&lt;LI&gt;missing/incorrect/malformed app key&lt;/LI&gt;
&lt;LI&gt;incorrect/malformed app secret&lt;/LI&gt;
&lt;LI&gt;missing app secret (if the refresh token was retrieved using the non-PKCE flow)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;The response body on that 400 error response would contain a more specific error message, though the .NET SDK unfortunately does not currently expose that. There's an open request to update it to do so.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, make sure you're supplying the correct values. Since it sounds like this is only happening for a few users though, but for all calls for those users, it may be that the refresh tokens for those users are revoked, in which case you should have the users relink the app to get a new one.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 21:10:04 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/400-BadRequest-from-Net-client-when-using-refresh-tokens/m-p/583092#M27164</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-03-11T21:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: 400 BadRequest from .Net client when using refresh tokens</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/400-BadRequest-from-Net-client-when-using-refresh-tokens/m-p/588492#M27401</link>
      <description>&lt;P&gt;Any examples on how the DropboxClient needs to be constructed for refresh tokens?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 15:20:39 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/400-BadRequest-from-Net-client-when-using-refresh-tokens/m-p/588492#M27401</guid>
      <dc:creator>Intellicode Mangement Systems</dc:creator>
      <dc:date>2022-04-05T15:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: 400 BadRequest from .Net client when using refresh tokens</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/400-BadRequest-from-Net-client-when-using-refresh-tokens/m-p/588496#M27403</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1407747"&gt;@ Intellicode Mangement Systems&lt;/a&gt; Yes, for &lt;A href="https://github.com/dropbox/dropbox-sdk-dotnet" target="_blank" rel="noreferrer nofollow noopener"&gt;the official Dropbox API v2 .NET SDK&lt;/A&gt;, you can find an example of getting and using a refresh token in &lt;A href="https://github.com/dropbox/dropbox-sdk-dotnet/blob/main/dropbox-sdk-dotnet/Examples/OauthBasic/Program.cs" target="_blank" rel="noreferrer nofollow noopener"&gt;the OauthBasic example&lt;/A&gt; (non-PKCE, meant for server-side apps) as well as in &lt;A href="https://github.com/dropbox/dropbox-sdk-dotnet/blob/main/dropbox-sdk-dotnet/Examples/OAuthPKCE/Program.cs" target="_blank" rel="noreferrer nofollow noopener"&gt;the OAuthPKCE example&lt;/A&gt; (PKCE, meant for client-side apps)&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 15:26:54 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/400-BadRequest-from-Net-client-when-using-refresh-tokens/m-p/588496#M27403</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-04-05T15:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: 400 BadRequest from .Net client when using refresh tokens</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/400-BadRequest-from-Net-client-when-using-refresh-tokens/m-p/588507#M27404</link>
      <description>&lt;P&gt;Response status code does not indicate success: 400 (Bad Request).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Still the reponse I am geting no luck!!!&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 15:45:31 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/400-BadRequest-from-Net-client-when-using-refresh-tokens/m-p/588507#M27404</guid>
      <dc:creator>Intellicode Mangement Systems</dc:creator>
      <dc:date>2022-04-05T15:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: 400 BadRequest from .Net client when using refresh tokens</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/400-BadRequest-from-Net-client-when-using-refresh-tokens/m-p/588508#M27405</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1407747"&gt;@ Intellicode Mangement Systems&lt;/a&gt; This isn't enough information for me to offer guidance on why that may be failing for you. I understand you have a support ticket open with more information though, so we'll review that and follow up with you there soon.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 15:49:39 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/400-BadRequest-from-Net-client-when-using-refresh-tokens/m-p/588508#M27405</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-04-05T15:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: 400 BadRequest from .Net client when using refresh tokens</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/400-BadRequest-from-Net-client-when-using-refresh-tokens/m-p/588509#M27406</link>
      <description>&lt;P&gt;Please I am doing everything send by the support team step by step but no luck.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 15:53:26 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/400-BadRequest-from-Net-client-when-using-refresh-tokens/m-p/588509#M27406</guid>
      <dc:creator>Intellicode Mangement Systems</dc:creator>
      <dc:date>2022-04-05T15:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: 400 BadRequest from .Net client when using refresh tokens</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/400-BadRequest-from-Net-client-when-using-refresh-tokens/m-p/588510#M27407</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1407747"&gt;@ Intellicode Mangement Systems&lt;/a&gt; Your support ticket is currently open so it will be reviewed and receive further help soon.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2022 15:57:08 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/400-BadRequest-from-Net-client-when-using-refresh-tokens/m-p/588510#M27407</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-04-05T15:57:08Z</dc:date>
    </item>
  </channel>
</rss>

