Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

QOOQ's avatar
QOOQ
New member | Level 1
10 years ago

Authentication Error on iOS (Core API v1)

There seems to be an authentication that might randomly happen the first time the app links to dropbox. (it happened in 2 out of 6 tries). However it seems to work correctly if the app is restarted.

The flow is, Link to dropbox, when successful and when the focus returns to my app, i try uploading a file, then I get the following error:

2015-10-16 19:29:50.499 appName[300:29495] [WARNING] DropboxSDK: error making request to /1/files_put/auto/Backup (2015-10-16 at 1929).zip - (401) Authentication failed

2015-10-16 19:29:50.499 appName[300:29495] File upload failed with error: Error Domain=dropbox.com Code=401 "(null)" UserInfo={sourcePath=/private/var/mobile/Containers/Data/Application/9357CDDE-0F42-4AE5-B5AD-7151BA370FC5/tmp/Backup (2015-10-16 at 1929).zip, destinationPath=/Backup (2015-10-16 at 1929).zip, error=Authentication failed}

2015-10-16 19:29:50.500 appName[300:29495] File upload failed with error (localized): The operation couldn’t be completed. (dropbox.com error 401.)

Also if i try requesting metadata i get this error:

2015-10-16 19:29:59.107 appName[300:29495] [WARNING] DropboxSDK: error making request to /1/metadata/auto - (400) invalid_request

2015-10-16 19:29:59.108 appName[300:29495] Error loading metadata: Error Domain=dropbox.com Code=400 "(null)" UserInfo={error_description=No auth function available for given request, path=/, error=invalid_request}

-------------------

However this is strange because it should ALREADY be linked, since i check it before performing the requests like this:

if (![[DBSession sharedSession] isLinked]) {
return;
}


By the way, i followed everything written on this guide: https://www.dropbox.com/developers-v1/core/start/ios

And as mentioned earlier, the weird thing is that, it might or might not happen the first time it is linked. So its kind of hard to replicate. Last time it happened, i closed the app, re-opened and it was suddenly fixed.

1 Reply

Replies have been turned off for this discussion
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    10 years ago

    [Moved to API Development forum]

    Apologies for the delay! In the future, be sure to post any issues regarding the API in particular in the API Development forum.

    Anyway, so we can help with this, please let us know:

    - the version number of the SDK you're using

    - the rest of the relevant code, e.g., where you create the session and client

    - if the sample app included with the SDK reproduces the issue for you too

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

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, Facebook or Instagram.

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!