Class: Blupee::Auth
- Inherits:
-
Object
- Object
- Blupee::Auth
- Defined in:
- lib/blupee/auth.rb
Instance Attribute Summary collapse
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
readonly
Returns the value of attribute client_secret.
Instance Method Summary collapse
-
#get_access_token(options = {}) ⇒ Object
Fetches the application’s access token (ignoring expiration and other info).
-
#get_access_token_info(options = {}) ⇒ Object
Fetches an access token, token expiration, and other info from Blupee.
-
#initialize(client_id = nil, client_secret = nil) ⇒ Auth
constructor
Creates a new client.
Constructor Details
Instance Attribute Details
#client_id ⇒ Object (readonly)
Returns the value of attribute client_id.
7 8 9 |
# File 'lib/blupee/auth.rb', line 7 def client_id @client_id end |
#client_secret ⇒ Object (readonly)
Returns the value of attribute client_secret.
7 8 9 |
# File 'lib/blupee/auth.rb', line 7 def client_secret @client_secret end |
Instance Method Details
#get_access_token(options = {}) ⇒ Object
Fetches the application’s access token (ignoring expiration and other info).
43 44 45 46 47 |
# File 'lib/blupee/auth.rb', line 43 def get_access_token( = {}) if info = get_access_token_info() Blupee.config.access_token = info["access_token"] end end |
#get_access_token_info(options = {}) ⇒ Object
Fetches an access token, token expiration, and other info from Blupee. Useful when you’ve received an OAuth code using the server-side authentication process.
32 33 34 35 |
# File 'lib/blupee/auth.rb', line 32 def get_access_token_info( = {}) # convenience method to get a the application's sessionless access token get_token_from_server({}, true, ) end |