Class: SdkOAuth2Session

Version 1.4 - Updated on 11/17/2016





OAuth 2.0 authorization helper for apps that can’t provide a redirect URI, such as the command line example apps.

Constructor Details

#initialize(consumer_key, consumer_secret, locale = nil) ⇒ SdkOAuth2FlowNoRedirect

  • consumer_key: Your application Key
  • consumer_secret: Your application Secret
  • locale: The locale of the user currently using your app.
def initialize(consumer_key, consumer_secret, locale=nil)
  super(consumer_key, consumer_secret, locale)

Instance Method Details

#finish(code) ⇒ Object

After the user approves your app, they are presented with an authorization code. The user should copy and paste the authorization code into your app and then call this method to obtain an access token.

Returns a two-entry list (access_token, user_id).

  • access_token is an access token string that can be passed to the SdkClient.
  • user_id is the user ID of the user that just approved your app.
def finish(code)
  _finish(code, nil)

#start ⇒ Object

Returns an authorization_url, where the user can give your app access to his or her Personal Cloud Storag content.

def start()
  _get_authorize_url(nil, nil)

Copyright © 2015-2017, Verizon and/or its Licensors. All rights reserved.

Version 1.5 - Updated on 12/15/2016


Instance Attribute Summary

Attributes inherited from SdkSessionBase:

  • #locale

Constructor Details

#initialize(oauth2_access_token, locale = nil) ⇒ SdkOAuth2Session

Returns a new instance of SdkOAuth2Session.

def initialize(oauth2_access_token, locale=nil)
  if not oauth2_access_token.is_a?(String)
    raise "bad type for oauth2_access_token (expecting String)"
  @access_token = oauth2_access_token

Instance Method Details

#assert_authorized ⇒ Object

def assert_authorized

Copyright © 2015-2017, Verizon and/or its Licensors. All rights reserved.