We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Pawan A.
11 years agoNew member | Level 1
Authenticate internaly with dropbox through my app
Hello Everyone,
I have a photo studio app in this app
I want to user can upload them photos on my drop box folder through my app without registering on dropbox. When they upload photo through my app,My app should login internaly with my drop box credential without user intrection.
Thanks in adavance
10 Replies
Replies have been turned off for this discussion
- Greg-DB11 years ago
Dropbox Community Moderator
The Dropbox API was designed with the intention that each user would link their own Dropbox account, in order to interact with their own files. However, it is technically possible to connect to just one account. The SDKs don't offer explicit support for it and we don't recommend doing so, for various technical and security reasons.
However if you did want to go this route, instead of kicking off the authorization flow, you would manually use an existing access token for your app. (Just be careful not to revoke it, e.g. via https://www.dropbox.com/account/security .)
- juan g.211 years agoNew member | Level 1
Even being very insecure want to do this, but it still fails authentication.
Is there any example code for this task?Sorry my English, Thanks
- Greg-DB11 years ago
Dropbox Community Moderator
No, we don't have any sample code for this, since it isn't recommended. What error do you get?
- juan g.211 years agoNew member | Level 1
I do not get any errors simply skips the Log "No Authentification" something I'm not doing well.
Use token generated by the console application
This is my code:
- Greg-DB11 years ago
Dropbox Community Moderator
It looks like you're checking
authenticationSuccessfulbut this only returns true during an actual app authorization flow. However, since you're setting your access token manually, this doesn't apply. You can usedisLinkedto check if you have an access token set instead:Note that this doesn't validate the access token against the server though. If the access token has been revoked, later API calls will fail.
- juan g.211 years agoNew member | Level 1
Well he was right, now goes well but I have another dilemma ...
No files get access here, notice in my codigome fails in
Entry entry = mDBApi.metadata ("/ dropfiles.dat", 1, null, false, null);my code:
http://pastebin.com/ufJ8Vda7 - Greg-DB11 years ago
Dropbox Community Moderator
How does it fail? (What's the error/stack?)
- juan g.211 years agoNew member | Level 1
- Greg-DB11 years ago
Dropbox Community Moderator
You're getting a
NetworkOnMainThreadException, which only isn't specific to Dropbox. In short, you shouldn't make network calls (for example, Dropbox API calls likemetadatawhich call the Dropbox API servers) on the main thread. You can find more information here:https://developer.android.com/reference/android/os/NetworkOnMainThreadException.html
- juan g.211 years agoNew member | Level 1
Ups! If the error was that, thank you very much for your help, I will continue with my development
About 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!