Search code examples
phpandroiddropboxdropbox-api

dropbox save access tokens in db


i have developed an android and web-app.both these app uses drop-box library. in android app i get two access tokens from the android drop-box library.. but in web-app in which i am using a php library i get only one one access token ... am i missing something ? because the problem which i having is i am sending two tokens which i am getting from android app to my webapp database so that i can use these tokens to access the dropbox from webapp without asking the user permission from webapp.. so i want to ask if some one has use the dropbox php library, how many tokens they get ? do they get two tokens or only one?


Solution

  • You should only be receiving one token for each request; see the Core API PHP documentation.

    The general process is:

    1. Get request token
    2. Authorise the app using the request token
    3. Get access token from the authorisation

    So you should only be receiving one request token. I'd check to make sure that your Android app isn't requesting 2 tokens by mistake.

    Edit: The above is correct with PHP authentication. However, with Android and Java, you receive 2 parts to the access token - a key and a secret, much like a username and password. This means that you won't be able to use the Android access token in PHP.