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: 

Dropbox Bearer token is too short

Dropbox Bearer token is too short

TheKrominator
Explorer | Level 3

When I log in to DropBox, I get approved and receive my auth token. But, the token is too short!

I should receive : "################################-###############################"

but I get :             "###################-#######################"

This returns a "invalid_access_token" error. 

 

Below is my layout for passport-dropbox-oauth2:

app.get('/dropboxLogin', passport.authenticate('dropbox-oauth2'));

app.get('/auth/dropbox/callback',
passport.authenticate('dropbox-oauth2', { failureRedirect: '/' }),
function(req, res)
{
// Successful authentication, redirect home.
res.render('index', { title:'Dropbox Login', body:res});
});

app.get('/loggedIn', function(req,res)
{
//have bearer token
let token = req.query.code;
console.log(req.query);
res.redirect('/Callback/?token='+token);
});

1 Accepted Solution

Accepted Solutions

Re: Dropbox Bearer token is too short

Greg-DB
Dropboxer

It sounds like you're using the "code" flow, so Dropbox will return an "authorization code", not an access token. When using the code flow, once you receive the authorization code, you need to then exchange it for an access token using /oauth2/token.

 

Check out the /oauth2/authorize and /oauth2/token documentation for more information on how this works.

View solution in original post

1 Reply 1

Re: Dropbox Bearer token is too short

Greg-DB
Dropboxer

It sounds like you're using the "code" flow, so Dropbox will return an "authorization code", not an access token. When using the code flow, once you receive the authorization code, you need to then exchange it for an access token using /oauth2/token.

 

Check out the /oauth2/authorize and /oauth2/token documentation for more information on how this works.

View solution in original post

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
What do Dropbox user levels mean?
Need more support?