cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done 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: 

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.

Poll
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?
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?