Class: DropboxOAuth2FlowNoRedirect
- Inherits:
-
DropboxOAuth2FlowBase
- Object
- DropboxOAuth2FlowBase
- DropboxOAuth2FlowNoRedirect
- Defined in:
- lib/dropbox_sdk.rb
Overview
OAuth 2 authorization helper for apps that can’t provide a redirect URI (such as the command line example apps).
Instance Method Summary collapse
-
#finish(code) ⇒ Object
If the user approves your app, they will be presented with an “authorization code”.
-
#initialize(consumer_key, consumer_secret, locale = nil) ⇒ DropboxOAuth2FlowNoRedirect
constructor
-
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.
-
-
#start ⇒ Object
Returns a authorization_url, which is a page on Dropbox’s website.
Methods inherited from DropboxOAuth2FlowBase
Constructor Details
#initialize(consumer_key, consumer_secret, locale = nil) ⇒ DropboxOAuth2FlowNoRedirect
-
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.
501 502 503 |
# File 'lib/dropbox_sdk.rb', line 501 def initialize(consumer_key, consumer_secret, locale=nil) super(consumer_key, consumer_secret, locale) end |
Instance Method Details
#finish(code) ⇒ Object
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.
518 519 520 |
# File 'lib/dropbox_sdk.rb', line 518 def finish(code) _finish(code, nil) end |
#start ⇒ Object
Returns a authorization_url, which is a page on Dropbox’s website. Have the user visit this URL and approve your app.
507 508 509 |
# File 'lib/dropbox_sdk.rb', line 507 def start() (nil, nil) end |