Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to get oauth2 authorization code explicitly
    primarykey
    data
    text
    <p>I'm writing a simple Dropbox app in Python that upload/Download files. Here is the particular piece of code that I am working with that creates a connection to a Dropbox account.</p> <pre><code>flow = dropbox.client.DropboxOAuth2FlowNoRedirect(app_key, app_secret) # Have the user sign in and authorize this token authorize_url = flow.start() print '1. Go to: ' + authorize_url print '2. Click "Allow" (you might have to log in first)' print '3. Copy the authorization code.' code = raw_input("Enter the authorization code here: ").strip() # This will fail if the user enters an invalid authorization code access_token, user_id = flow.finish(code) client = dropbox.client.DropboxClient(access_token) print 'linked account: ', client.account_info() f = open('data.txt') response = client.put_file('/magnum-opus.txt', f) print 'uploaded: ', response folder_metadata = client.metadata('/') print 'metadata: ', folder_metadata f, metadata = client.get_file_and_metadata('/magnum-opus.txt') out = open('magnum-opus.txt', 'w') out.write(f.read()) out.close() print metadata </code></pre> <p>It seems to work fine, but I am wary of the way I am checking for authentication. The code above will open a link in the user's default browser to his/her Dropbox account to allow access to this app. But i want to skip these steps and get explicit authorized code. i had read <a href="https://www.dropbox.com/developers/core/docs#oa2-authorize" rel="nofollow">doc</a> but it does not helps me. Does anyone have any idea how to get this code? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload