We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
rms u.
10 years agoExplorer | Level 4
Error occurred after visiting authorization URL
Hi,
I am upgrading to Dropbox Core SDK 2.0.6 for Java. When I add dropbox account, I encounter this error:
SEVERE: {"error_description": "unknown field \"state\"", "error": "invalid_request"} com.dropbox.core.BadRequestException: {"error_description": "unknown field \"state\"", "error": "invalid_request"}
If I don't specify state, it works fine.
This is my snippet code:
//dropbox-start
DbxSessionStore csrfTokenStore = new DbxStandardSessionStore(session, DB_AUTH_CSRF_TOKEN_KEY);
DbxWebAuth auth = getWebAuth(request, user);
com.dropbox.core.DbxWebAuth.Request.Builder builder = Request.newBuilder();
builder.withState("n:" + name);
builder.withRedirectUri(redirectURL, csrfTokenStore);
Request dropboxRequest = builder.build();
String authorizeUrl = auth.authorize(dropboxRequest);
...
//dropbox-finish
DbxAuthFinish authFinish = auth.finishFromRedirect(redirectURL, csrfTokenStore, request.getParameterMap());
Thanks
3 Replies
- Alexandra F.110 years agoNew member | Level 1
Thanks for the report, this looks like a bug on our side. I'll send it along to our team.
- rms u.10 years agoExplorer | Level 4
Hi Alexandra,
Referring to the source code
https://github.com/dropbox/dropbox-sdk-java/blob/v2.0.6/src/main/java/com/dropbox/core/DbxWebAuth.java (line 382), DBxWebAuth will send state to oauth2 dropbox server.
Thanks
- Greg-DB10 years ago
Dropbox Community Moderator
This should be fixed in version 2.1.0. Please try it out and let us know if you're still seeing any issues.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
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!