cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more 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: 

Re: Dropbox Bearer token is too short

Dropbox Bearer token is too short

TheKrominator
Explorer | Level 3
Go to solution

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

Greg-DB
Dropbox Staff
Go to solution

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

Greg-DB
Dropbox Staff
Go to solution

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.

Need more support?