<?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: Java SDK getting &amp;quot;Invalid authorization value in HTTP header/URL parameter&amp;quot; in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-getting-quot-Invalid-authorization-value-in-HTTP-header/m-p/761633#M33273</link>
    <description>&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1820234"&gt;@UserMateUser&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;What's that 'token' variable and where it comes from? &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@9AD39CA637682E9616FBE31CDAF1B6C4/emoticons/1f914.png" alt=":thinking_face:" title=":thinking_face:" /&gt; Did you try dump it just before client construction? If not, check this at the beginning.&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;</description>
    <pubDate>Wed, 03 Apr 2024 20:37:36 GMT</pubDate>
    <dc:creator>Здравко</dc:creator>
    <dc:date>2024-04-03T20:37:36Z</dc:date>
    <item>
      <title>Java SDK getting "Invalid authorization value in HTTP header/URL parameter"</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-getting-quot-Invalid-authorization-value-in-HTTP-header/m-p/761606#M33271</link>
      <description>&lt;P&gt;Hello!&lt;BR /&gt;I'm using Java SDK and trying to add dropbox into my app. I was following the guide from dropbox github&amp;nbsp;&lt;A href="https://github.com/dropbox/dropbox-sdk-java/tree/main" target="_blank" rel="noopener"&gt;https://github.com/dropbox/dropbox-sdk-java/tree/main&lt;/A&gt;&lt;BR /&gt;When I try to check if it works, I get exception from the subject at the line with&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;FullAccount account = &lt;SPAN&gt;dropboxClient&lt;/SPAN&gt;.users().getCurrentAccount()&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;(dropboxClient is an instance of DbxClientV2)&lt;BR /&gt;&lt;BR /&gt;I initialize dropbox client as a bean on startup using access token generated from api dev console, token seems to be passed correctly as I debuged it during initialization&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="UserMateUser_0-1712171796582.png" style="width: 400px;"&gt;&lt;img src="https://www.dropboxforum.com/t5/image/serverpage/image-id/45207i6720E9F0A156909C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="UserMateUser_0-1712171796582.png" alt="UserMateUser_0-1712171796582.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This client is later autowired inside a service&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="UserMateUser_1-1712172356014.png" style="width: 400px;"&gt;&lt;img src="https://www.dropboxforum.com/t5/image/serverpage/image-id/45208i22655873C01A3744/image-size/medium?v=v2&amp;amp;px=400" role="button" title="UserMateUser_1-1712172356014.png" alt="UserMateUser_1-1712172356014.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But when it comes to the client call in the debugger I see that access token is empty, while config seems to be correctly passed&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="UserMateUser_2-1712172533049.png" style="width: 400px;"&gt;&lt;img src="https://www.dropboxforum.com/t5/image/serverpage/image-id/45209i7EEE5C6F444176F2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="UserMateUser_2-1712172533049.png" alt="UserMateUser_2-1712172533049.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I initializing it wrong? Maybe there should be other parameters, or I need to additionaly authorize my app before trying to use any methods?&lt;BR /&gt;&lt;BR /&gt;Oh and also, as I understood, if the app to be deployed somewhere, there should be used another way of authorization for other users?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 19:32:18 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-getting-quot-Invalid-authorization-value-in-HTTP-header/m-p/761606#M33271</guid>
      <dc:creator>UserMateUser</dc:creator>
      <dc:date>2024-04-03T19:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: Java SDK getting "Invalid authorization value in HTTP header/URL parameter"</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-getting-quot-Invalid-authorization-value-in-HTTP-header/m-p/761631#M33272</link>
      <description>&lt;P&gt;It looks like you're using &lt;A href="https://dropbox.github.io/dropbox-sdk-java/api-docs/v5.4.3/com/dropbox/core/v2/DbxClientV2.html#%3Cinit%3E(com.dropbox.core.DbxRequestConfig,java.lang.String)" target="_self"&gt;this constructor&lt;/A&gt;, where you provide the DbxRequestConfig and an access token String. That is fine and should work. To confirm, I tried this condensed version of your code, with the latest v6.1.0 of the Dropbox Java SDK:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;DbxRequestConfig config = DbxRequestConfig.newBuilder("TMS/1.0").build();
String token = "&amp;lt;REDACTED&amp;gt;";
DbxClientV2 dropboxClient = new DbxClientV2(config, token);
FullAccount account = dropboxClient.users().getCurrentAccount();
System.out.println(account.getName().getDisplayName());&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That worked successfully for me. You may want to also try this basic version to see if this works for you to try to narrow down where this is breaking in your setup.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And I see you mentioned checking that 'token' was set properly for you originally, but I recommend stepping through the rest of your process to see if/where something may be getting changed. We can't provide support for Beans or autowiring though, as that's not made by Dropbox.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For reference, there are a number of ways of using the Dropbox app authorization functionality, and exactly how you set it up will depend on your scenario and requirements. I recommend referring to the following resources for more information:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://developers.dropbox.com/oauth-guide" target="_blank"&gt;https://developers.dropbox.com/oauth-guide&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#authorization" target="_blank"&gt;https://www.dropbox.com/developers/documentation/http/documentation#authorization&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://dropbox.tech/developers/using-oauth-2-0-with-offline-access" target="_blank"&gt;https://dropbox.tech/developers/using-oauth-2-0-with-offline-access&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://github.com/dropbox/dropbox-sdk-java/tree/main/examples/examples/src/main/java/com/dropbox/core/examples/authorize" target="_blank"&gt;https://github.com/dropbox/dropbox-sdk-java/tree/main/examples/examples/src/main/java/com/dropbox/core/examples/authorize&lt;/A&gt; &lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 03 Apr 2024 20:35:42 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-getting-quot-Invalid-authorization-value-in-HTTP-header/m-p/761631#M33272</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2024-04-03T20:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: Java SDK getting "Invalid authorization value in HTTP header/URL parameter"</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-getting-quot-Invalid-authorization-value-in-HTTP-header/m-p/761633#M33273</link>
      <description>&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1820234"&gt;@UserMateUser&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;What's that 'token' variable and where it comes from? &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@9AD39CA637682E9616FBE31CDAF1B6C4/emoticons/1f914.png" alt=":thinking_face:" title=":thinking_face:" /&gt; Did you try dump it just before client construction? If not, check this at the beginning.&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 20:37:36 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Java-SDK-getting-quot-Invalid-authorization-value-in-HTTP-header/m-p/761633#M33273</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2024-04-03T20:37:36Z</dc:date>
    </item>
  </channel>
</rss>

