Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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
WARNING: POST request for "https://www.dropbox.com/1/oauth2/authorize" resulted in 403 (Forbidden); invoking error handler
Exception in thread "main" error="access_denied", error_description="Error requesting access token."
My code looks like
private String authorizeWithImplicitFlow() {
ImplicitResourceDetails details = new ImplicitResourceDetails();
details.setPreEstablishedRedirectUri("https://www.irctc.co.in");
details.setAccessTokenUri("https://www.dropbox.com/1/oauth2/authorize");
HashMap<String, String[]> parameters = new HashMap<String, String[]>();
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();
}
What could be reason for the 403 error? Note that I was able to successfully access the API through REST client (POSTMAN)
www.dropbox.com/1/oauth2/authorize
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.
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?
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!