class DropboxOAuth2FlowNoRedirect

OAuth 2 authorization helper for apps that can't provide a redirect URI (such as the command line example apps).

Public Class Methods

new(consumer_key, consumer_secret, locale=nil) click to toggle source
  • consumer_key: Your Dropbox API app's “app key”

  • consumer_secret: Your Dropbox API app's “app secret”

  • locale: The locale of the user currently using your app.

Calls superclass method
# File lib/dropbox_sdk.rb, line 488
def initialize(consumer_key, consumer_secret, locale=nil)
  super(consumer_key, consumer_secret, locale)
end

Public Instance Methods

finish(code) click to toggle source

If the user approves your app, they will be presented with an “authorization code”. Have the user copy/paste that authorization code into your app and then call this method to get an access token.

Returns a two-entry list (access_token, user_id)

  • access_token is an access token string that can be passed to DropboxClient.

  • user_id is the Dropbox user ID of the user that just approved your app.

# File lib/dropbox_sdk.rb, line 505
def finish(code)
  _finish(code, nil)
end
start() click to toggle source

Returns a authorization_url, which is a page on Dropbox's website. Have the user visit this URL and approve your app.

# File lib/dropbox_sdk.rb, line 494
def start()
  _get_authorize_url(nil, nil)
end