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
-
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.
# File lib/dropbox_sdk.rb, line 501 def initialize(consumer_key, consumer_secret, locale=nil) super(consumer_key, consumer_secret, locale) end
Public Instance Methods
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 518 def finish(code) _finish(code, nil) end
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 507 def start() _get_authorize_url(nil, nil) end