Cut the Clutter: Test Ignore Files Feature - sign up to become a beta tester here.
Forum Discussion
FawazT
7 months agoNew member | Level 1
Requests fail if client secret isn't added when using the javascript sdk
I'm implementing the pkce flow correctly, I'm creating a dropbox object and adding the app key and refresh token, but when trying to use the check app method it will throw an exception with the error "Error in call to API function "check/app": Invalid authorization value in HTTP header/URL parameter", adding the app secret will solve this issue but I can't do that because I have to ship my app to the user, trying the same app key and refresh token in the c# sdk works and according to posts on the forum this should also work with the javascript sdk, here is my code:
const auth = new DropboxAuth();
auth.setRefreshToken("xxxxx");
auth.setClientId("xxxxx");
// auth.setClientSecret("xxxxx");
const dbx = new Dropbox({auth: auth});
try {
const res = await dbx.checkApp({ query: "test" });
console.log(res);
} catch (e) {
console.log(e);
}
This is the expected behavior if attempting checkApp without an app secret; the checkApp method validates the app key and secret by calling /2/check/app which uses "App Authentication", which does require the app key and secret. So, that will fail without the app secret.
If you want to check the validity of the access token, use checkUser instead.
2 Replies
- FawazT7 months agoNew member | Level 1
Manually calling checkAndRefreshAccessToken will also get the access token but it still returns the same error when calling checkApp
- Greg-DB7 months ago
Dropbox Community Moderator
This is the expected behavior if attempting checkApp without an app secret; the checkApp method validates the app key and secret by calling /2/check/app which uses "App Authentication", which does require the app key and secret. So, that will fail without the app secret.
If you want to check the validity of the access token, use checkUser instead.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,037 PostsLatest Activity: 21 hours ago
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 or Facebook.
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!