cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We recently received a question asking for advice on how to set up a Dropbox account for an elderly family member. This prompted us to think about the different ways we can make Dropbox more accessible in general, learn about it and add your tips right over here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
1
Ask
2
Reply and help

Error occurred after visiting authorization URL

Error occurred after visiting authorization URL

rms u.
Explorer | Level 4

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 3

Re: Error occurred after visiting authorization URL

Alexandra F.1
New member | Level 1

Thanks for the report, this looks like a bug on our side. I'll send it along to our team.

Re: Error occurred after visiting authorization URL

rms u.
Explorer | 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.ja... (line 382), DBxWebAuth will send state to oauth2 dropbox server.

 

Thanks

Re: Error occurred after visiting authorization URL

Greg-DB
Dropboxer

This should be fixed in version 2.1.0. Please try it out and let us know if you're still seeing any issues.

Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
  • User avatar
    rms u. Explorer | Level 4
  • User avatar
    Alexandra F.1 New member | Level 1
What do Dropbox user levels mean?
Need more support?