<?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: 403 Forbidden error on API access through Java in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/403-Forbidden-error-on-API-access-through-Java/m-p/47393#M1488</link>
    <description>&lt;P&gt;&lt;CODE&gt;www.dropbox.com/1/oauth2/authorize&lt;/CODE&gt; should only be accessed by a user, so I'm confused as to why your code is issuing a POST request to it at all.&lt;/P&gt;

&lt;P&gt;I've never used Spring, so I'm not really set up to help debug this. Perhaps you can get better help on a Spring forum?&lt;/P&gt;</description>
    <pubDate>Tue, 24 Feb 2015 00:18:50 GMT</pubDate>
    <dc:creator>Steve M.</dc:creator>
    <dc:date>2015-02-24T00:18:50Z</dc:date>
    <item>
      <title>403 Forbidden error on API access through Java</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/403-Forbidden-error-on-API-access-through-Java/m-p/47392#M1487</link>
      <description>&lt;P&gt;I am trying to call dropbox's API's through a java based client (spring security) but I get a 403 (Forbidden) error when I do that. The error is&lt;/P&gt;

&lt;P&gt;WARNING: POST request for "&lt;A href="https://www.dropbox.com/1/oauth2/authorize" rel="nofollow noreferrer" target="_blank"&gt;https://www.dropbox.com/1/oauth2/authorize&lt;/A&gt;" resulted in 403 (Forbidden); invoking error handler&lt;BR /&gt;
Exception in thread "main" error="access_denied", error_description="Error requesting access token."&lt;/P&gt;

&lt;P&gt;My code looks like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;private String authorizeWithImplicitFlow() {
    ImplicitResourceDetails details = new ImplicitResourceDetails();
    details.setPreEstablishedRedirectUri("https://www.irctc.co.in");
    details.setAccessTokenUri("https://www.dropbox.com/1/oauth2/authorize");

    HashMap&amp;lt;String, String[]&amp;gt; parameters = new HashMap&amp;lt;String, String[]&amp;gt;();
    parameters.put("response_type", new String[] {"token"});
    parameters.put("client_id", new String[]{CLIENT_ID});
    OAuth2RestTemplate template = new OAuth2RestTemplate(details, new DefaultOAuth2ClientContext(new DefaultAccessTokenRequest(parameters)));
    OAuth2AccessToken token = template.getAccessToken();
    return token.getValue();
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What could be reason for the 403 error? Note that I was able to successfully access the API through REST client (POSTMAN)&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:44:56 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/403-Forbidden-error-on-API-access-through-Java/m-p/47392#M1487</guid>
      <dc:creator>Amit1</dc:creator>
      <dc:date>2019-05-29T09:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: 403 Forbidden error on API access through Java</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/403-Forbidden-error-on-API-access-through-Java/m-p/47393#M1488</link>
      <description>&lt;P&gt;&lt;CODE&gt;www.dropbox.com/1/oauth2/authorize&lt;/CODE&gt; should only be accessed by a user, so I'm confused as to why your code is issuing a POST request to it at all.&lt;/P&gt;

&lt;P&gt;I've never used Spring, so I'm not really set up to help debug this. Perhaps you can get better help on a Spring forum?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2015 00:18:50 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/403-Forbidden-error-on-API-access-through-Java/m-p/47393#M1488</guid>
      <dc:creator>Steve M.</dc:creator>
      <dc:date>2015-02-24T00:18:50Z</dc:date>
    </item>
  </channel>
</rss>

