dropbox-sdk-js: authTokenFromOauth1 not working
Hi, the authTokenFromOauth1 method doesn’t work because it uses “app” authorization, which isn’t implemented in the SDK. It throws this error: “Unhandled auth type: app”
I managed to workaround by setting the “Authorization” header to “Basic <base64 encoded app_key:app_secret>” when rpcRequest’s auth parameter (in rpc-request.js) is “app”. I had to pass the app_key and app_secret along with the object that supplies the oauth1_token and oauth1_token_secret properties to authTokenFromOauth1. To prevent causing a server-side error, I had to delete them from the object right after using them to prevent them being sent along with the actual API request.
case 'app': apiRequest.set('Authorization', 'Basic ' + btoa(body.app_key + ":" + body.app_secret); delete body.app_key; delete body.app_secret; break;
Can you guys fix this please?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 17 (12 by maintainers)
Commits related to this issue
- Support 'app' auth method for rpc requests Fixes https://github.com/dropbox/dropbox-sdk-js/issues/114 — committed to pran1990/dropbox-sdk-js by deleted user 6 years ago
- Changes/new flags - Minor changes to work with stone/spec changes - Standarize on exports - Breaking change for non-browser environments. Uses suggestions in https://github.com/dropbox/dropbox-sdk... — committed to pran1990/dropbox-sdk-js by deleted user 7 years ago
- Changes/new headers - Minor changes to work with stone/spec changes - Standarize on exports - Breaking change for non-browser environments. Uses suggestions in https://github.com/dropbox/dropbox-s... — committed to pran1990/dropbox-sdk-js by deleted user 7 years ago
Thank you for the update. The v1 API is set to stop working in 30 days. Can you please fix this immediately so we can have a smooth migration?