2

I'm developing android app, using the Dropbox API on Android. The API has a link activity to link an account with the app.

I have the app key and app secret and the Dropbox account and the password, and I need to put this info in the code programmatically.

What I don't want is this login/link activity, assuming I have a Dropbox account and password and I want to link/authenticate programmatically with this particular account without demanding the user to link or login or input any account or password.

Can I do that?

user94559
  • 59,196
  • 6
  • 103
  • 103
mhdjazmati
  • 4,152
  • 1
  • 26
  • 37
  • Why is it so important? I mean, the link is only made one time, then the app has access to Dropbox until uninstalled – cYrixmorten Sep 20 '15 at 13:05
  • @cYrixmorten i want all the users who use this app to not know the account nor the password i'm linking them to , cuz im using 1 account to store some infos that i dont want the user to use the account and access on the regular dropbox website and see the files. like database etc .. – mhdjazmati Sep 20 '15 at 13:16
  • 1
    Then I would advise you to use Parse.com or similar instead. – cYrixmorten Sep 20 '15 at 14:17
  • @cYrixmorten could you explain more maybe a link or tutorial ? sorry im note familiar with Parse.com – mhdjazmati Sep 20 '15 at 14:25
  • Try and go to their website, they have plenty of tutorials and documentation :-) – cYrixmorten Sep 20 '15 at 14:49
  • The original question regarding Dropbox is basically a duplicate of this: https://stackoverflow.com/questions/15014001/allow-dropbox-api-to-access-my-account-on-users-device (and others) – Greg Sep 20 '15 at 18:54
  • 1
    Parse was good untill it died last week. Jan 2016) – Utsav Gupta Feb 03 '16 at 08:48
  • @UtsavGupta really , it did ? – mhdjazmati Feb 04 '16 at 10:29
  • 1
    @mhdjazmati Yup, They are winding within 6 months and calling it off totally within a year. I see some conspiracy there. – Utsav Gupta Feb 04 '16 at 11:03

1 Answers1

1

well i found actually dropbox offered what i want to do .

now dropbox will let you generate public access token and use it inside your code

so yes , there is a way to allow permanent access to dropbox API. we need to generate access token from the application settings(dropbox console) and use it. Here is what dropbox says:

By generating an access token, you will be able to make API calls for your own account without going through the authorization flow. To obtain access tokens for other users, use the standard OAuth flow.

in code words :

AndroidAuthSession session = buildSession();
mApi = new DropboxAPI<AndroidAuthSession>(session);

    private AndroidAuthSession buildSession() {
        AppKeyPair appKeyPair = new AppKeyPair(APP_KEY, APP_SECRET);
        AndroidAuthSession session = new AndroidAuthSession(appKeyPair, ACCESS_TOKEN);
        // I guess then you just have to instantiate a DropboxAPI object and you're good to go without the startAuthentication()... endAuthentication() etc.
        return session;
    }

and here we go just use the mApi to do whatever you want

mhdjazmati
  • 4,152
  • 1
  • 26
  • 37